Skip to content

Instantly share code, notes, and snippets.

@misterhtmlcss
Created February 5, 2021 21:21
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 misterhtmlcss/67220bac559ad1a69bfeee3b670deb08 to your computer and use it in GitHub Desktop.
Save misterhtmlcss/67220bac559ad1a69bfeee3b670deb08 to your computer and use it in GitHub Desktop.
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