mirror of
https://github.com/cerc-io/watcher-ts
synced 2025-02-03 16:52:49 +00:00
30 lines
407 B
GraphQL
30 lines
407 B
GraphQL
|
type Author {
|
||
|
id: Int!
|
||
|
firstName: String
|
||
|
lastName: String
|
||
|
"""
|
||
|
the list of Posts by this author
|
||
|
"""
|
||
|
posts: [Post]
|
||
|
}
|
||
|
|
||
|
type Post {
|
||
|
id: Int!
|
||
|
title: String
|
||
|
author: Author
|
||
|
votes: Int
|
||
|
}
|
||
|
|
||
|
# the schema allows the following query:
|
||
|
type Query {
|
||
|
posts: [Post]
|
||
|
author(id: Int!): Author
|
||
|
}
|
||
|
|
||
|
# this schema allows the following mutation:
|
||
|
type Mutation {
|
||
|
upvotePost (
|
||
|
postId: Int!
|
||
|
): Post
|
||
|
}
|