# DO NOT MODIFY THIS FILE. This file is automatically generated by Tina
"""
References another document, used as a foreign key
"""
scalar Reference

"""

"""
scalar JSON

type SystemInfo {
  filename: String!
  basename: String!
  breadcrumbs(excludeExtension: Boolean): [String!]!
  path: String!
  relativePath: String!
  extension: String!
  template: String!
  collection: Collection!
}

type PageInfo {
  hasPreviousPage: Boolean!
  hasNextPage: Boolean!
  startCursor: String!
  endCursor: String!
}

"""

"""
interface Node {
  id: ID!
}

"""

"""
interface Document {
  sys: SystemInfo
  id: ID!
  form: JSON!
  values: JSON!
}

"""
A relay-compliant pagination connection
"""
interface Connection {
  totalCount: Float!
}

type Query {
  getCollection(collection: String): Collection!
  getCollections: [Collection!]!
  node(id: String): Node!
  getDocument(collection: String, relativePath: String): DocumentNode!
  getDocumentList(
    before: String
    after: String
    first: Float
    last: Float
  ): DocumentConnection!
  getDocumentFields: JSON!
  getPostsDocument(relativePath: String): PostsDocument!
  getPostsList(
    before: String
    after: String
    first: Float
    last: Float
  ): PostsConnection!
}

type DocumentConnectionEdges {
  cursor: String
  node: DocumentNode
}

type DocumentConnection implements Connection {
  pageInfo: PageInfo
  totalCount: Float!
  edges: [DocumentConnectionEdges]
}

type Collection {
  name: String!
  slug: String!
  label: String
  path: String!
  format: String
  matches: String
  templates: [JSON]
  fields: [JSON]
  documents(
    before: String
    after: String
    first: Float
    last: Float
  ): DocumentConnection!
}

union DocumentNode = PostsDocument

type PostsAuthor {
  name: String
  picture: String
}

type PostsOgImage {
  url: String
}

type Posts {
  title: String
  excerpt: String
  coverImage: String
  date: String
  author: PostsAuthor
  ogImage: PostsOgImage
  body: String
}

type PostsDocument implements Node & Document {
  id: ID!
  sys: SystemInfo!
  data: Posts!
  form: JSON!
  values: JSON!
  dataJSON: JSON!
}

type PostsConnectionEdges {
  cursor: String
  node: PostsDocument
}

type PostsConnection implements Connection {
  pageInfo: PageInfo
  totalCount: Float!
  edges: [PostsConnectionEdges]
}

type Mutation {
  addPendingDocument(
    collection: String!
    relativePath: String!
    template: String
  ): DocumentNode!
  updateDocument(
    collection: String
    relativePath: String!
    params: DocumentMutation!
  ): DocumentNode!
  createDocument(
    collection: String
    relativePath: String!
    params: DocumentMutation!
  ): DocumentNode!
  updatePostsDocument(
    relativePath: String!
    params: PostsMutation!
  ): PostsDocument!
  createPostsDocument(
    relativePath: String!
    params: PostsMutation!
  ): PostsDocument!
}

input DocumentMutation {
  posts: PostsMutation
}

input PostsAuthorMutation {
  name: String
  picture: String
}

input PostsOgImageMutation {
  url: String
}

input PostsMutation {
  title: String
  excerpt: String
  coverImage: String
  date: String
  author: PostsAuthorMutation
  ogImage: PostsOgImageMutation
  body: String
}

schema {
  query: Query
  mutation: Mutation
}
