Skip to content

Instantly share code, notes, and snippets.

@SachaG
Created January 30, 2018 01:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SachaG/55fee16e56b81a24320ce44a1ff5ce6a to your computer and use it in GitHub Desktop.
Save SachaG/55fee16e56b81a24320ce44a1ff5ce6a to your computer and use it in GitHub Desktop.
# Type for Movies
type Movie {
_id: String
createdAt: Date
user: User
userId: String
name: String
year: String
review: String
}
# Type for Movies (input type)
input MoviesInput {
name: String
year: String
review: String
}
# Type for Movies (unset input type)
input MoviesUnset {
name: Boolean
year: Boolean
review: Boolean
}
type Query {
# A list of Movies documents matching a set of query terms
MoviesList(
# A JSON object that contains the query terms used to fetch data
terms: JSON,
# How much to offset the results by
offset: Int,
# A limit for the query
limit: Int,
# Whether to enable caching for this query
enableCache: Boolean
): [Movie]
# A single Movies document fetched by ID or slug
MoviesSingle(
# The document\'s unique ID
documentId: String,
# A unique slug identifying the document
slug: String,
# Whether to enable caching for this query
enableCache: Boolean
): Movie
# The total count of Movies documents matching a set of query terms
MoviesTotal(
# A JSON object that contains the query terms used to fetch data
terms: JSON,
# Whether to enable caching for this query
enableCache: Boolean
): Int
}
type Mutation {
# Mutation for inserting new Movies documents
MoviesNew(
# The document to insert
document: MoviesInput
) : Movie
# Mutation for editing a Movies document
MoviesEdit(
# The unique ID of the document to edit
documentId: String,
# An array of fields to insert
set: MoviesInput,
# An array of fields to delete
unset: MoviesUnset
) : Movie
# Mutation for deleting a Movies document
MoviesRemove(
# The unique ID of the document to delete
documentId: String
) : Movie
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment