-
Notifications
You must be signed in to change notification settings - Fork 3
/
basic-schema.graphql
109 lines (91 loc) · 1.88 KB
/
basic-schema.graphql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
scalar Date
interface Node {
id: ID!
}
type PageInfo {
hasNextPage: Boolean!
hasPreviousPage: Boolean!
startCursor: String
endCursor: String
}
type User implements Node {
id: ID!
name: String!
# avatar url
avatar: String!
posts(after: String, first: Int, before: String, last: Int): PostConnection
comments(after: String, first: Int, before: String, last: Int): CommentConnection
}
type Post implements Node {
id: ID!
slug: String
author: User!
title: String!
content: String!
created: Date!
comments(after: String, first: Int, before: String, last: Int): CommentConnection
}
type PostEdge {
node: Post
cursor: String!
}
type PostConnection {
pageInfo: PageInfo!
edges: [PostEdge]
}
type Comment implements Node {
id: ID!
author: User!
content: String!
created: Date!
reply: Comment
post: Post!
}
type CommentEdge {
node: Comment
cursor: String!
}
type CommentConnection {
pageInfo: PageInfo!
edges: [CommentEdge]
}
type Viewer {
user: User
posts(after: String, first: Int, before: String, last: Int): PostConnection
}
input CreateUserInput {
name: String!
avatar: String
}
type CreateUserPayload {
user: User
clientMutationId: String
}
input CreatePostInput {
title: String!
content: String!
clientMutationId: String
}
type CreatePostPayload {
post: Post
clientMutationId: String
}
input CreateCommentInput {
content: String!
reply: ID
post: ID!
clientMutationId: String
}
type CreateCommentPayload {
comment: Comment
clientMutationId: String
}
type Query {
viewer: Viewer!
node(id: ID!): Node
}
type Mutation {
createUser(input: CreateUserInput!): CreateUserPayload
createPost(input: CreatePostInput!): CreatePostPayload
createComment(input: CreateCommentInput!): CreateCommentPayload
}