HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers10/shop.komma.nl/node_modules/@vue/cli-ui/apollo-server/schema/git.js
const gql = require('graphql-tag')
// Connectors
const git = require('../connectors/git')

exports.types = gql`
extend type Query {
  fileDiffs: [FileDiff]
}

extend type Mutation {
  gitCommit (message: String!): Boolean
}

type FileDiff {
  id: ID!
  from: String
  to: String
  new: Boolean
  deleted: Boolean
  binary: Boolean
  chunks: [FileDiffChunk]
}

type FileDiffChunk {
  changes: [FileDiffChange]
  oldStart: Int
  oldLines: Int
  newStart: Int
  newLines: Int
}

type FileDiffChange {
  type: FileDiffChangeType
  ln: Int
  ln1: Int
  ln2: Int
  content: String
  normal: Boolean
}

enum FileDiffChangeType {
  normal
  add
  del
}
`

exports.resolvers = {
  Query: {
    fileDiffs: (root, args, context) => git.getDiffs(context)
  },

  Mutation: {
    gitCommit: (root, { message }, context) => git.commit(message, context)
  }
}