Skip to content

Commit b8326d0

Browse files
committed
Add a demo
1 parent 40fdfc6 commit b8326d0

2 files changed

Lines changed: 42 additions & 0 deletions

File tree

example/package.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"graphql-doctor": {
3+
"schema.graphql": {
4+
"ref": "heads/master",
5+
"schemaPath": "schema.graphql"
6+
}
7+
}
8+
}

example/schema.graphql

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
type Author {
2+
id: Int!
3+
firstName: String
4+
lastName: String
5+
"""
6+
the list of Posts by this author
7+
"""
8+
posts: [Post]
9+
}
10+
11+
enum UserRole {
12+
ROLE_ADMIN
13+
ROLE_USER
14+
}
15+
16+
type Post {
17+
id: Int!
18+
title: String
19+
author: Author
20+
votes: Int
21+
}
22+
23+
# the schema allows the following query:
24+
type Query {
25+
posts: [Post]
26+
author(id: Int! = 1): Author
27+
}
28+
29+
# this schema allows the following mutation:
30+
type Mutation {
31+
upvotePost (
32+
postId: Int
33+
): Post
34+
}

0 commit comments

Comments
 (0)