forked from dotansimha/graphql-code-generator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flow.flow.js
367 lines (327 loc) · 9.71 KB
/
flow.flow.js
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
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
// @flow
// @flow
/** All built-in and custom scalars, mapped to their actual values */
export type Scalars = {|
ID: string,
String: string,
Boolean: boolean,
Int: number,
Float: number,
|};
export type Query = {|
__typename?: 'Query',
/** A feed of repository submissions */
feed?: ?Array<?Entry>,
/** A single entry */
entry?: ?Entry,
/** Return the currently logged in user, or null if nobody is logged in */
currentUser?: ?User,
|};
export type QueryFeedArgs = {|
type: FeedType,
offset?: ?$ElementType<Scalars, 'Int'>,
limit?: ?$ElementType<Scalars, 'Int'>,
|};
export type QueryEntryArgs = {|
repoFullName: $ElementType<Scalars, 'String'>,
|};
export const FeedTypeValues = Object.freeze({
/** Sort by a combination of freshness and score, using Reddit's algorithm */
Hot: 'HOT',
/** Newest entries first */
New: 'NEW',
/** Highest score entries first */
Top: 'TOP',
});
/** A list of options for the sort order of the feed */
export type FeedType = $Values<typeof FeedTypeValues>;
/** Information about a GitHub repository submitted to GitHunt */
export type Entry = {|
__typename?: 'Entry',
/** Information about the repository from GitHub */
repository: Repository,
/** The GitHub user who submitted this entry */
postedBy: User,
/** A timestamp of when the entry was submitted */
createdAt: $ElementType<Scalars, 'Float'>,
/** The score of this repository, upvotes - downvotes */
score: $ElementType<Scalars, 'Int'>,
/** The hot score of this repository */
hotScore: $ElementType<Scalars, 'Float'>,
/** Comments posted about this repository */
comments: Array<?Comment>,
/** The number of comments posted about this repository */
commentCount: $ElementType<Scalars, 'Int'>,
/** The SQL ID of this entry */
id: $ElementType<Scalars, 'Int'>,
/** XXX to be changed */
vote: Vote,
|};
/** Information about a GitHub repository submitted to GitHunt */
export type EntryCommentsArgs = {|
limit?: ?$ElementType<Scalars, 'Int'>,
offset?: ?$ElementType<Scalars, 'Int'>,
|};
/**
* 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.
*/
export type Repository = {|
__typename?: 'Repository',
/** Just the name of the repository, e.g. GitHunt-API */
name: $ElementType<Scalars, 'String'>,
/** The full name of the repository with the username, e.g. apollostack/GitHunt-API */
full_name: $ElementType<Scalars, 'String'>,
/** The description of the repository */
description?: ?$ElementType<Scalars, 'String'>,
/** The link to the repository on GitHub */
html_url: $ElementType<Scalars, 'String'>,
/** The number of people who have starred this repository on GitHub */
stargazers_count: $ElementType<Scalars, 'Int'>,
/** The number of open issues on this repository on GitHub */
open_issues_count?: ?$ElementType<Scalars, 'Int'>,
/** The owner of this repository on GitHub, e.g. apollostack */
owner?: ?User,
|};
/** A user object from the GitHub API. This uses the exact field names returned from the GitHub API. */
export type User = {|
__typename?: 'User',
/** The name of the user, e.g. apollostack */
login: $ElementType<Scalars, 'String'>,
/** The URL to a directly embeddable image for this user's avatar */
avatar_url: $ElementType<Scalars, 'String'>,
/** The URL of this user's GitHub page */
html_url: $ElementType<Scalars, 'String'>,
|};
/** A comment about an entry, submitted by a user */
export type Comment = {|
__typename?: 'Comment',
/** The SQL ID of this entry */
id: $ElementType<Scalars, 'Int'>,
/** The GitHub user who posted the comment */
postedBy: User,
/** A timestamp of when the comment was posted */
createdAt: $ElementType<Scalars, 'Float'>,
/** The text of the comment */
content: $ElementType<Scalars, 'String'>,
/** The repository which this comment is about */
repoName: $ElementType<Scalars, 'String'>,
|};
/** XXX to be removed */
export type Vote = {|
__typename?: 'Vote',
vote_value: $ElementType<Scalars, 'Int'>,
|};
export type Mutation = {|
__typename?: 'Mutation',
/** Submit a new repository, returns the new submission */
submitRepository?: ?Entry,
/** Vote on a repository submission, returns the submission that was voted on */
vote?: ?Entry,
/** Comment on a repository, returns the new comment */
submitComment?: ?Comment,
|};
export type MutationSubmitRepositoryArgs = {|
repoFullName: $ElementType<Scalars, 'String'>,
|};
export type MutationVoteArgs = {|
repoFullName: $ElementType<Scalars, 'String'>,
type: VoteType,
|};
export type MutationSubmitCommentArgs = {|
repoFullName: $ElementType<Scalars, 'String'>,
commentContent: $ElementType<Scalars, 'String'>,
|};
export const VoteTypeValues = Object.freeze({
Up: 'UP',
Down: 'DOWN',
Cancel: 'CANCEL',
});
/** The type of vote to record, when submitting a vote */
export type VoteType = $Values<typeof VoteTypeValues>;
export type Subscription = {|
__typename?: 'Subscription',
/** Subscription fires on every comment added */
commentAdded?: ?Comment,
|};
export type SubscriptionCommentAddedArgs = {|
repoFullName: $ElementType<Scalars, 'String'>,
|};
type $Pick<Origin: Object, Keys: Object> = $ObjMapi<Keys, <Key>(k: Key) => $ElementType<Origin, Key>>;
export type OnCommentAddedSubscriptionVariables = {
repoFullName: $ElementType<Scalars, 'String'>,
};
export type OnCommentAddedSubscription = {
...{ __typename?: 'Subscription' },
...{|
commentAdded?: ?{
...{ __typename?: 'Comment' },
...$Pick<Comment, {| id: *, createdAt: *, content: * |}>,
...{|
postedBy: {
...{ __typename?: 'User' },
...$Pick<User, {| login: *, html_url: * |}>,
},
|},
},
|},
};
export type CommentQueryVariables = {
repoFullName: $ElementType<Scalars, 'String'>,
limit?: ?$ElementType<Scalars, 'Int'>,
offset?: ?$ElementType<Scalars, 'Int'>,
};
export type CommentQuery = {
...{ __typename?: 'Query' },
...{|
currentUser?: ?{
...{ __typename?: 'User' },
...$Pick<User, {| login: *, html_url: * |}>,
},
entry?: ?{
...{ __typename?: 'Entry' },
...$Pick<Entry, {| id: *, createdAt: *, commentCount: * |}>,
...{|
postedBy: {
...{ __typename?: 'User' },
...$Pick<User, {| login: *, html_url: * |}>,
},
comments: Array<?{
...{ __typename?: 'Comment' },
...CommentsPageCommentFragment,
}>,
repository: {
...{ __typename?: 'Repository' },
...$Pick<
Repository,
{| description?: *, open_issues_count?: *, stargazers_count: *, full_name: *, html_url: * |}
>,
},
|},
},
|},
};
export type CommentsPageCommentFragment = {
...{ __typename?: 'Comment' },
...$Pick<Comment, {| id: *, createdAt: *, content: * |}>,
...{|
postedBy: {
...{ __typename?: 'User' },
...$Pick<User, {| login: *, html_url: * |}>,
},
|},
};
export type CurrentUserForProfileQueryVariables = {};
export type CurrentUserForProfileQuery = {
...{ __typename?: 'Query' },
...{|
currentUser?: ?{
...{ __typename?: 'User' },
...$Pick<User, {| login: *, avatar_url: * |}>,
},
|},
};
export type FeedEntryFragment = {
...{ __typename?: 'Entry' },
...$Pick<Entry, {| id: *, commentCount: * |}>,
...{|
repository: {
...{ __typename?: 'Repository' },
...$Pick<Repository, {| full_name: *, html_url: * |}>,
...{|
owner?: ?{
...{ __typename?: 'User' },
...$Pick<User, {| avatar_url: * |}>,
},
|},
},
|},
...VoteButtonsFragment,
...RepoInfoFragment,
};
export type FeedQueryVariables = {
type: FeedType,
offset?: ?$ElementType<Scalars, 'Int'>,
limit?: ?$ElementType<Scalars, 'Int'>,
};
export type FeedQuery = {
...{ __typename?: 'Query' },
...{|
currentUser?: ?{
...{ __typename?: 'User' },
...$Pick<User, {| login: * |}>,
},
feed?: ?Array<?{
...{ __typename?: 'Entry' },
...FeedEntryFragment,
}>,
|},
};
export type SubmitRepositoryMutationVariables = {
repoFullName: $ElementType<Scalars, 'String'>,
};
export type SubmitRepositoryMutation = {
...{ __typename?: 'Mutation' },
...{|
submitRepository?: ?{
...{ __typename?: 'Entry' },
...$Pick<Entry, {| createdAt: * |}>,
},
|},
};
export type RepoInfoFragment = {
...{ __typename?: 'Entry' },
...$Pick<Entry, {| createdAt: * |}>,
...{|
repository: {
...{ __typename?: 'Repository' },
...$Pick<Repository, {| description?: *, stargazers_count: *, open_issues_count?: * |}>,
},
postedBy: {
...{ __typename?: 'User' },
...$Pick<User, {| html_url: *, login: * |}>,
},
|},
};
export type SubmitCommentMutationVariables = {
repoFullName: $ElementType<Scalars, 'String'>,
commentContent: $ElementType<Scalars, 'String'>,
};
export type SubmitCommentMutation = {
...{ __typename?: 'Mutation' },
...{|
submitComment?: ?{
...{ __typename?: 'Comment' },
...CommentsPageCommentFragment,
},
|},
};
export type VoteButtonsFragment = {
...{ __typename?: 'Entry' },
...$Pick<Entry, {| score: * |}>,
...{|
vote: {
...{ __typename?: 'Vote' },
...$Pick<Vote, {| vote_value: * |}>,
},
|},
};
export type VoteMutationVariables = {
repoFullName: $ElementType<Scalars, 'String'>,
type: VoteType,
};
export type VoteMutation = {
...{ __typename?: 'Mutation' },
...{|
vote?: ?{
...{ __typename?: 'Entry' },
...$Pick<Entry, {| score: *, id: * |}>,
...{|
vote: {
...{ __typename?: 'Vote' },
...$Pick<Vote, {| vote_value: * |}>,
},
|},
},
|},
};