Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
directive @embedded on OBJECT
directive @collection(name: String!) on OBJECT
directive @index(name: String!) on FIELD_DEFINITION
directive @resolver(
name: String
paginated: Boolean! = false
) on FIELD_DEFINITION
directive @relation(name: String) on FIELD_DEFINITION
directive @unique(index: String) on FIELD_DEFINITION
scalar Date
# The `Long` scalar type
represents non-fractional signed whole numeric values.
# Long can represent values between -(2^63) and 2^63 - 1.
scalar Long
type Mutation {
# Create a new document in the collection of 'Post'
createPost(
# 'Post' input values
data: PostInput!
): Post!
# Update an existing document in the collection of 'Post'
updatePost(
# The 'Post' document's ID
id: ID!
# 'Post' input values
data: PostInput!
): Post
# Delete an existing document in the collection of 'Post'
deletePost(
# The 'Post' document's ID
id: ID!
): Post
}
type Post {
# The document's ID.
_id: ID!
# The document's timestamp.
_ts: Long!
title: String
}
# 'Post' input values
input PostInput {
title: String
}
# The pagination object for elements of type 'Post'.
type PostPage {
# The elements of type 'Post' in this page.
data: [Post]!
# A cursor for elements coming after the current page.
after: String
# A cursor for elements coming before the current page.
before: String
}
type Query {
# Find a document from the collection of 'Post' by its id.
findPostByID(
# The 'Post' document's ID
id: ID!
): Post
posts(
# The number of items to return per page.
_size: Int
# The pagination cursor.
_cursor: String
): PostPage!
}
scalar Time
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment