type File {
  title: String
  content: String!
}

type SavedContentField {
  label: String!
  url: String!
}

type SavedContentMeta {
  mergeRequest: SavedContentField!
  commit: SavedContentField!
  branch: SavedContentField!
}

type Mount {
  source: String!
  target: String
}

type AppData {
  isSupportedContent: Boolean!
  hasSubmittedChanges: Boolean!
  project: String!
  returnUrl: String
  sourcePath: String!
  username: String!
  branch: String!
  baseUrl: String!
  mounts: [Mount]!
  imageUploadPath: String!
}

input HasSubmittedChangesInput {
  hasSubmittedChanges: Boolean!
}

input SubmitContentChangesInput {
  project: String!
  sourcePath: String!
  content: String!
  username: String!
}

extend type Project {
  file(path: ID!): File
}

extend type Query {
  appData: AppData!
  savedContentMeta: SavedContentMeta
}

extend type Mutation {
  submitContentChanges(input: SubmitContentChangesInput!): SavedContentMeta
  hasSubmittedChanges(input: HasSubmittedChangesInput!): AppData
}
