-
Notifications
You must be signed in to change notification settings - Fork 275
/
githunt-api-schema.graphql
245 lines (207 loc) · 3.97 KB
/
githunt-api-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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
### This file was generated by Nexus Schema
### Do not make changes to this file directly
"""
A comment about an entry, submitted by a user
"""
type Comment {
"""
The text of the comment
"""
content: String
"""
A timestamp of when the comment was posted
"""
createdAt: Float
"""
The SQL ID of this entry
"""
id: Int
"""
The GitHub user who posted the comment
"""
postedBy: User
"""
The repository which this comment is about
"""
repoName: String
}
type Entry {
"""
The number of comments posted about this repository
"""
commentCount: Int
"""
Comments posted about this repository
"""
comments(limit: Int, offset: Int): [Comment]
"""
A timestamp of when the entry was submitted
"""
createdAt: Float
"""
The hot score of this repository
"""
hotScore: Float
"""
The SQL ID of this entry
"""
id: Int
"""
The GitHub user who posted the comment
"""
postedBy: User
"""
Information about the repository from GitHub
"""
repository: Repository
"""
The score of this repository, upvotes - downvotes
"""
score: Int
"""
XXX to be changed
"""
vote: Vote
}
"""
A list of options for the sort order of the feed
"""
enum FeedType {
"""
Sort by a combination of freshness and score, using Reddit's algorithm
"""
HOT
"""
Newest entries first
"""
NEW
"""
Highest score entries first
"""
TOP
}
type Mutation {
submitComment(
"""
The text content for the new comment
"""
commentContent: String!
"""
The full repository name from GitHub, e.g. "apollostack/GitHunt-API"
"""
repoFullName: String!
): Comment
"""
Submit a new repository, returns the new submission
"""
submitRepository(
"""
The full repository name from GitHub, e.g. "apollostack/GitHunt-API"
"""
repoFullName: String!
): Entry
"""
Vote on a repository submission, returns the submission that was voted on
"""
vote(
"""
The full repository name from GitHub, e.g. "apollostack/GitHunt-API"
"""
repoFullName: String!
"""
The type of vote - UP, DOWN, or CANCEL
"""
type: VoteType!
): Entry
}
type Query {
"""
Return the currently logged in user, or null if nobody is logged in
"""
currentUser: User
"""
A single entry
"""
entry(
"""
The full repository name from GitHub, e.g. "apollostack/GitHunt-API"
"""
repoFullName: String!
): Entry
feed(
"""
The number of items to fetch starting from the offset, for pagination
"""
limit: Int
"""
The number of items to skip, for pagination
"""
offset: Int
"""
The sort order for the feed
"""
type: FeedType!
): [Entry]
}
"""
A repository object from the GitHub API. This uses the exact field names returned by the
GitHub API for simplicity, even though the convention for GraphQL is usually to camel case.
"""
type Repository {
"""
The description of the repository
"""
description: String
"""
The full name of the repository with the username, e.g. apollostack/GitHunt-API
"""
full_name: String
"""
The link to the repository on GitHub
"""
html_url: String
"""
Just the name of the repository, e.g. GitHunt-API
"""
name: String
"""
The number of open issues on this repository on GitHub
"""
open_issues_count: Int
"""
The owner of this repository on GitHub, e.g. apollostack
"""
owner: User
"""
The number of people who have starred this repository on GitHub
"""
stargazers_count: Int
}
"""
A user object from the GitHub API. This uses the exact field names returned from the GitHub API.
"""
type User {
"""
The URL to a directly embeddable image for this user's avatar
"""
avatar_url: String
"""
The URL of this user's GitHub page
"""
html_url: String
"""
The name of the user, e.g. apollostack
"""
login: String
}
type Vote {
vote_value: Int
}
"""
The type of vote to record, when submitting a vote
"""
enum VoteType {
CANCEL
DOWN
UP
}