forked from dotansimha/graphql-code-generator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.d.ts
319 lines (284 loc) · 8.65 KB
/
types.d.ts
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
/* tslint:disable */
export interface Query {
feed?: (Entry | null)[] | null /** A feed of repository submissions */;
entry?: Entry | null /** A single entry */;
currentUser?: User | null /** Return the currently logged in user, or null if nobody is logged in */;
}
/** Information about a GitHub repository submitted to GitHunt */
export interface Entry {
repository: Repository /** Information about the repository from GitHub */;
postedBy: User /** The GitHub user who submitted this entry */;
createdAt: number /** A timestamp of when the entry was submitted */;
score: number /** The score of this repository, upvotes - downvotes */;
hotScore: number /** The hot score of this repository */;
comments: (Comment | null)[] /** Comments posted about this repository */;
commentCount: number /** The number of comments posted about this repository */;
id: number /** The SQL ID of this entry */;
vote: Vote /** XXX to be changed */;
}
/** A repository object from the GitHub API. This uses the exact field names returned by theGitHub API for simplicity, even though the convention for GraphQL is usually to camel case. */
export interface Repository {
name: string /** Just the name of the repository, e.g. GitHunt-API */;
full_name: string /** The full name of the repository with the username, e.g. apollostack/GitHunt-API */;
description?: string | null /** The description of the repository */;
html_url: string /** The link to the repository on GitHub */;
stargazers_count: number /** The number of people who have starred this repository on GitHub */;
open_issues_count?: number | null /** The number of open issues on this repository on GitHub */;
owner?: User | null /** The owner of this repository on GitHub, e.g. apollostack */;
}
/** A user object from the GitHub API. This uses the exact field names returned from the GitHub API. */
export interface User {
login: string /** The name of the user, e.g. apollostack */;
avatar_url: string /** The URL to a directly embeddable image for this user's avatar */;
html_url: string /** The URL of this user's GitHub page */;
}
/** A comment about an entry, submitted by a user */
export interface Comment {
id: number /** The SQL ID of this entry */;
postedBy: User /** The GitHub user who posted the comment */;
createdAt: number /** A timestamp of when the comment was posted */;
content: string /** The text of the comment */;
repoName: string /** The repository which this comment is about */;
}
/** XXX to be removed */
export interface Vote {
vote_value: number;
}
export interface Mutation {
submitRepository?: Entry | null /** Submit a new repository, returns the new submission */;
vote?: Entry | null /** Vote on a repository submission, returns the submission that was voted on */;
submitComment?: Comment | null /** Comment on a repository, returns the new comment */;
}
export interface Subscription {
commentAdded?: Comment | null /** Subscription fires on every comment added */;
}
export interface FeedQueryArgs {
type: FeedType /** The sort order for the feed */;
offset?: number | null /** The number of items to skip, for pagination */;
limit?: number | null /** The number of items to fetch starting from the offset, for pagination */;
}
export interface EntryQueryArgs {
repoFullName: string /** The full repository name from GitHub, e.g. "apollostack/GitHunt-API" */;
}
export interface CommentsEntryArgs {
limit?: number | null;
offset?: number | null;
}
export interface SubmitRepositoryMutationArgs {
repoFullName: string /** The full repository name from GitHub, e.g. "apollostack/GitHunt-API" */;
}
export interface VoteMutationArgs {
repoFullName: string /** The full repository name from GitHub, e.g. "apollostack/GitHunt-API" */;
type: VoteType /** The type of vote - UP, DOWN, or CANCEL */;
}
export interface SubmitCommentMutationArgs {
repoFullName: string /** The full repository name from GitHub, e.g. "apollostack/GitHunt-API" */;
commentContent: string /** The text content for the new comment */;
}
export interface CommentAddedSubscriptionArgs {
repoFullName: string;
}
/** A list of options for the sort order of the feed */
export type FeedType = 'HOT' | 'NEW' | 'TOP';
/** The type of vote to record, when submitting a vote */
export type VoteType = 'UP' | 'DOWN' | 'CANCEL';
export namespace OnCommentAdded {
export type Variables = {
repoFullName: string;
};
export type Subscription = {
__typename?: 'Subscription';
commentAdded?: CommentAdded | null;
};
export type CommentAdded = {
__typename?: 'Comment';
id: number;
postedBy: PostedBy;
createdAt: number;
content: string;
};
export type PostedBy = {
__typename?: 'User';
login: string;
html_url: string;
};
}
export namespace Comment {
export type Variables = {
repoFullName: string;
limit?: number | null;
offset?: number | null;
};
export type Query = {
__typename?: 'Query';
currentUser?: CurrentUser | null;
entry?: Entry | null;
};
export type CurrentUser = {
__typename?: 'User';
login: string;
html_url: string;
};
export type Entry = {
__typename?: 'Entry';
id: number;
postedBy: PostedBy;
createdAt: number;
comments: (Comments | null)[];
commentCount: number;
repository: Repository;
};
export type PostedBy = {
__typename?: 'User';
login: string;
html_url: string;
};
export type Comments = CommentsPageComment.Fragment;
export type Repository = {
__typename?: RepositoryInlineFragment['__typename'];
full_name: string;
html_url: string;
} & (RepositoryInlineFragment);
export type RepositoryInlineFragment = {
__typename?: 'Repository';
description?: string | null;
open_issues_count?: number | null;
stargazers_count: number;
};
}
export namespace CurrentUserForProfile {
export type Variables = {};
export type Query = {
__typename?: 'Query';
currentUser?: CurrentUser | null;
};
export type CurrentUser = {
__typename?: 'User';
login: string;
avatar_url: string;
};
}
export namespace Feed {
export type Variables = {
type: FeedType;
offset?: number | null;
limit?: number | null;
};
export type Query = {
__typename?: 'Query';
currentUser?: CurrentUser | null;
feed?: (Feed | null)[] | null;
};
export type CurrentUser = {
__typename?: 'User';
login: string;
};
export type Feed = FeedEntry.Fragment;
}
export namespace SubmitRepository {
export type Variables = {
repoFullName: string;
};
export type Mutation = {
__typename?: 'Mutation';
submitRepository?: SubmitRepository | null;
};
export type SubmitRepository = {
__typename?: 'Entry';
createdAt: number;
};
}
export namespace SubmitComment {
export type Variables = {
repoFullName: string;
commentContent: string;
};
export type Mutation = {
__typename?: 'Mutation';
submitComment?: SubmitComment | null;
};
export type SubmitComment = CommentsPageComment.Fragment;
}
export namespace Vote {
export type Variables = {
repoFullName: string;
type: VoteType;
};
export type Mutation = {
__typename?: 'Mutation';
vote?: Vote | null;
};
export type Vote = {
__typename?: 'Entry';
score: number;
id: number;
vote: _Vote;
};
export type _Vote = {
__typename?: 'Vote';
vote_value: number;
};
}
export namespace CommentsPageComment {
export type Fragment = {
__typename?: 'Comment';
id: number;
postedBy: PostedBy;
createdAt: number;
content: string;
};
export type PostedBy = {
__typename?: 'User';
login: string;
html_url: string;
};
}
export namespace FeedEntry {
export type Fragment = {
__typename?: 'Entry';
id: number;
commentCount: number;
repository: Repository;
} & VoteButtons.Fragment &
RepoInfo.Fragment;
export type Repository = {
__typename?: 'Repository';
full_name: string;
html_url: string;
owner?: Owner | null;
};
export type Owner = {
__typename?: 'User';
avatar_url: string;
};
}
export namespace RepoInfo {
export type Fragment = {
__typename?: 'Entry';
createdAt: number;
repository: Repository;
postedBy: PostedBy;
};
export type Repository = {
__typename?: 'Repository';
description?: string | null;
stargazers_count: number;
open_issues_count?: number | null;
};
export type PostedBy = {
__typename?: 'User';
html_url: string;
login: string;
};
}
export namespace VoteButtons {
export type Fragment = {
__typename?: 'Entry';
score: number;
vote: Vote;
};
export type Vote = {
__typename?: 'Vote';
vote_value: number;
};
}