-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.graphql
139 lines (116 loc) · 2.22 KB
/
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
interface Error {
message: String!
code: String!
}
type NotFoundError implements Error {
message: String!
code: String!
}
enum ItemType {
Story
Job
Comment
Poll
PollOpt
}
type PageInfo {
totalResults: Int!
}
type ReplyNode {
node: Comment
}
type RepliesConnection {
pageInfo: PageInfo
edges: [ReplyNode]!
}
interface Item {
author: User!
id: Int!
type: ItemType!
}
type Story implements Item {
author: User!
id: Int!
replies(first: Int! = 10, after: Int): RepliesConnection!
score: Int
title: String!
type: ItemType!
url: String
}
type Comment implements Item {
author: User!
id: Int!
replies(first: Int! = 10, after: Int): RepliesConnection!
text: String!
type: ItemType!
}
type Job implements Item {
author: User!
id: Int!
score: Int
title: String!
type: ItemType!
url: String
}
type PollOption implements Item {
author: User!
id: Int!
score: Int
type: ItemType!
text: String!
}
type PollOptionNode {
node: PollOption
}
type PollOptionConnection {
pageInfo: PageInfo
edges: [PollOptionNode]!
}
type Poll implements Item {
author: User!
id: Int!
score: Int
title: String!
type: ItemType!
replies(first: Int! = 10, after: Int): RepliesConnection!
options(first: Int! = 10, after: Int): PollOptionConnection!
}
union UserItem = Story | Comment | Job | Poll | PollOption
type UserItemNode {
node: UserItem
}
type UserItemsConnection {
pageInfo: PageInfo
edges: [UserItemNode]!
}
type User {
about: String
karma: Int
username: ID!
items(first: Int! = 10, after: Int): UserItemsConnection
}
union ItemResult = Story | Comment | Job | Poll | PollOption | NotFoundError
union UserResult = User | NotFoundError
type ItemNode {
node: ItemResult!
}
type ItemsResult {
pageInfo: PageInfo,
edges: [ItemNode]!
}
type JobItemNode {
node: Job!
}
type JobsResult {
pageInfo: PageInfo,
edges: [JobItemNode]!
}
type Query {
ask(first: Int! = 10, after: Int): ItemsResult!
best(first: Int! = 10, after: Int): ItemsResult!
item(id: Int!): ItemResult!
jobs(first: Int! = 10, after: Int): JobsResult!
new(first: Int! = 10, after: Int): ItemsResult!
top(first: Int! = 10, after: Int): ItemsResult!
user(username: ID!): UserResult!
}