-
Notifications
You must be signed in to change notification settings - Fork 2
/
nexus-typegen.ts
537 lines (508 loc) · 16.8 KB
/
nexus-typegen.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
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
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
/**
* This file was generated by Nexus Schema
* Do not make changes to this file directly
*/
import type { Context } from "./src/context"
import type { FieldAuthorizeResolver } from "nexus/dist/plugins/fieldAuthorizePlugin"
import type { core } from "nexus"
declare global {
interface NexusGenCustomInputMethods<TypeName extends string> {
date<FieldName extends string>(fieldName: FieldName, opts?: core.CommonInputFieldConfig<TypeName, FieldName>): void // "Date";
}
}
declare global {
interface NexusGenCustomOutputMethods<TypeName extends string> {
date<FieldName extends string>(fieldName: FieldName, ...opts: core.ScalarOutSpread<TypeName, FieldName>): void // "Date";
}
}
declare global {
interface NexusGen extends NexusGenTypes {}
}
export interface NexusGenInputs {
ChangeUserPasswordInput: { // input type
currentPassword: string; // String!
id: number; // Int!
newPassword: string; // String!
}
CourseInput: { // input type
code: string; // String!
section: number; // Int!
subject: string; // String!
}
CoursePreferenceInput: { // input type
code: string; // String!
preference: number; // Int!
subject: string; // String!
term: NexusGenEnums['Term']; // Term!
}
CourseSectionInput: { // input type
capacity: number; // Int!
endDate: NexusGenScalars['Date']; // Date!
hoursPerWeek: number; // Float!
id: NexusGenInputs['CourseUpdateInput']; // CourseUpdateInput!
meetingTimes: NexusGenInputs['MeetingTimeInput'][]; // [MeetingTimeInput!]!
professors: string[]; // [String!]!
sectionNumber?: string | null; // String
startDate: NexusGenScalars['Date']; // Date!
}
CourseUpdateInput: { // input type
code: string; // String!
subject: string; // String!
term: NexusGenEnums['Term']; // Term!
title: string; // String!
}
CreateTeachingPreferenceInput: { // input type
courses: NexusGenInputs['CoursePreferenceInput'][]; // [CoursePreferenceInput!]!
fallTermCourses?: number | null; // Int
hasRelief: boolean; // Boolean!
hasTopic: boolean; // Boolean!
nonTeachingTerm?: NexusGenEnums['Term'] | null; // Term
peng: boolean; // Boolean!
reliefReason?: string | null; // String
springTermCourses?: number | null; // Int
summerTermCourses?: number | null; // Int
topicDescription?: string | null; // String
userId: string; // ID!
}
CreateUserInput: { // input type
name?: string | null; // String
password: string; // String!
role: NexusGenEnums['Role']; // Role!
username: string; // String!
}
GenerateScheduleInput: { // input type
algorithm1: NexusGenEnums['Company']; // Company!
algorithm2: NexusGenEnums['Company']; // Company!
fallCourses?: NexusGenInputs['CourseInput'][] | null; // [CourseInput!]
springCourses?: NexusGenInputs['CourseInput'][] | null; // [CourseInput!]
summerCourses?: NexusGenInputs['CourseInput'][] | null; // [CourseInput!]
year: number; // Int!
}
MeetingTimeInput: { // input type
day: NexusGenEnums['Day']; // Day!
endTime: NexusGenScalars['Date']; // Date!
startTime: NexusGenScalars['Date']; // Date!
}
UpdateScheduleInput: { // input type
courses: NexusGenInputs['CourseSectionInput'][]; // [CourseSectionInput!]!
id?: string | null; // ID
skipValidation: boolean; // Boolean!
validation: NexusGenEnums['Company']; // Company!
}
UpdateUserInput: { // input type
active?: boolean | null; // Boolean
id: number; // Int!
name?: string | null; // String
role?: NexusGenEnums['Role'] | null; // Role
}
}
export interface NexusGenEnums {
Company: "COMPANY3" | "COMPANY4"
Day: "FRIDAY" | "MONDAY" | "SATURDAY" | "SUNDAY" | "THURSDAY" | "TUESDAY" | "WEDNESDAY"
Role: "ADMIN" | "USER"
Term: "FALL" | "SPRING" | "SUMMER"
}
export interface NexusGenScalars {
String: string
Int: number
Float: number
Boolean: boolean
ID: string
Date: any
}
export interface NexusGenObjects {
AuthPayload: { // root type
message?: string | null; // String
success: boolean; // Boolean!
token: string; // String!
}
CourseID: { // root type
code: string; // String!
subject: string; // String!
term: NexusGenEnums['Term']; // Term!
title?: string | null; // String
year: number; // Int!
}
CoursePreference: { // root type
id: NexusGenRootTypes['CourseID']; // CourseID!
preference: number; // Int!
}
CourseSection: { // root type
CourseID: NexusGenRootTypes['CourseID']; // CourseID!
capacity: number; // Int!
endDate: NexusGenScalars['Date']; // Date!
hoursPerWeek: number; // Float!
meetingTimes: NexusGenRootTypes['MeetingTime'][]; // [MeetingTime!]!
professors?: NexusGenRootTypes['User'][] | null; // [User!]
sectionNumber?: string | null; // String
startDate: NexusGenScalars['Date']; // Date!
}
CreateUserMutationResult: { // root type
message?: string | null; // String
password?: string | null; // String
success: boolean; // Boolean!
username?: string | null; // String
}
Error: { // root type
errors?: NexusGenRootTypes['Error'][] | null; // [Error!]
message: string; // String!
}
MeetingTime: { // root type
day: NexusGenEnums['Day']; // Day!
endTime: NexusGenScalars['Date']; // Date!
startTime: NexusGenScalars['Date']; // Date!
}
Mutation: {};
Query: {};
ResetPasswordMutationResult: { // root type
message?: string | null; // String
password?: string | null; // String
success: boolean; // Boolean!
}
Response: { // root type
message?: string | null; // String
success: boolean; // Boolean!
}
Schedule: { // root type
createdAt: NexusGenScalars['Date']; // Date!
id: string; // ID!
year: number; // Int!
}
TeachingPreferenceSurvey: { // root type
courses: NexusGenRootTypes['CoursePreference'][]; // [CoursePreference!]!
}
UpdateScheduleResponse: { // root type
errors?: string[] | null; // [String!]
message?: string | null; // String
success: boolean; // Boolean!
}
UpdateUserMutationResult: { // root type
errors?: NexusGenRootTypes['Error'][] | null; // [Error!]
user?: NexusGenRootTypes['User'] | null; // User
}
User: { // root type
active: boolean; // Boolean!
id: number; // Int!
name?: string | null; // String
password: string; // String!
role: NexusGenEnums['Role']; // Role!
username: string; // String!
}
}
export interface NexusGenInterfaces {
}
export interface NexusGenUnions {
}
export type NexusGenRootTypes = NexusGenObjects
export type NexusGenAllTypes = NexusGenRootTypes & NexusGenScalars & NexusGenEnums
export interface NexusGenFieldTypes {
AuthPayload: { // field return type
message: string | null; // String
success: boolean; // Boolean!
token: string; // String!
}
CourseID: { // field return type
code: string; // String!
subject: string; // String!
term: NexusGenEnums['Term']; // Term!
title: string | null; // String
year: number; // Int!
}
CoursePreference: { // field return type
id: NexusGenRootTypes['CourseID']; // CourseID!
preference: number; // Int!
}
CourseSection: { // field return type
CourseID: NexusGenRootTypes['CourseID']; // CourseID!
capacity: number; // Int!
endDate: NexusGenScalars['Date']; // Date!
hoursPerWeek: number; // Float!
meetingTimes: NexusGenRootTypes['MeetingTime'][]; // [MeetingTime!]!
professors: NexusGenRootTypes['User'][] | null; // [User!]
sectionNumber: string | null; // String
startDate: NexusGenScalars['Date']; // Date!
}
CreateUserMutationResult: { // field return type
message: string | null; // String
password: string | null; // String
success: boolean; // Boolean!
username: string | null; // String
}
Error: { // field return type
errors: NexusGenRootTypes['Error'][] | null; // [Error!]
message: string; // String!
}
MeetingTime: { // field return type
day: NexusGenEnums['Day']; // Day!
endTime: NexusGenScalars['Date']; // Date!
startTime: NexusGenScalars['Date']; // Date!
}
Mutation: { // field return type
changeUserPassword: NexusGenRootTypes['Response']; // Response!
createTeachingPreference: NexusGenRootTypes['Response']; // Response!
createUser: NexusGenRootTypes['CreateUserMutationResult']; // CreateUserMutationResult!
generateSchedule: NexusGenRootTypes['Response']; // Response!
login: NexusGenRootTypes['AuthPayload']; // AuthPayload!
logout: NexusGenRootTypes['AuthPayload']; // AuthPayload!
resetPassword: NexusGenRootTypes['ResetPasswordMutationResult']; // ResetPasswordMutationResult!
updateSchedule: NexusGenRootTypes['UpdateScheduleResponse']; // UpdateScheduleResponse!
updateUser: NexusGenRootTypes['UpdateUserMutationResult'] | null; // UpdateUserMutationResult
}
Query: { // field return type
allUsers: NexusGenRootTypes['User'][] | null; // [User!]
coursePreferences: NexusGenRootTypes['CoursePreference'][] | null; // [CoursePreference!]
courses: NexusGenRootTypes['CourseSection'][] | null; // [CourseSection!]
findUserById: NexusGenRootTypes['User'] | null; // User
me: NexusGenRootTypes['User'] | null; // User
schedule: NexusGenRootTypes['Schedule'] | null; // Schedule
survey: NexusGenRootTypes['TeachingPreferenceSurvey']; // TeachingPreferenceSurvey!
}
ResetPasswordMutationResult: { // field return type
message: string | null; // String
password: string | null; // String
success: boolean; // Boolean!
}
Response: { // field return type
message: string | null; // String
success: boolean; // Boolean!
}
Schedule: { // field return type
courses: NexusGenRootTypes['CourseSection'][] | null; // [CourseSection!]
createdAt: NexusGenScalars['Date']; // Date!
id: string; // ID!
year: number; // Int!
}
TeachingPreferenceSurvey: { // field return type
courses: NexusGenRootTypes['CoursePreference'][]; // [CoursePreference!]!
}
UpdateScheduleResponse: { // field return type
errors: string[] | null; // [String!]
message: string | null; // String
success: boolean; // Boolean!
}
UpdateUserMutationResult: { // field return type
errors: NexusGenRootTypes['Error'][] | null; // [Error!]
user: NexusGenRootTypes['User'] | null; // User
}
User: { // field return type
active: boolean; // Boolean!
id: number; // Int!
name: string | null; // String
password: string; // String!
preferences: NexusGenRootTypes['CoursePreference'][] | null; // [CoursePreference!]
role: NexusGenEnums['Role']; // Role!
username: string; // String!
}
}
export interface NexusGenFieldTypeNames {
AuthPayload: { // field return type name
message: 'String'
success: 'Boolean'
token: 'String'
}
CourseID: { // field return type name
code: 'String'
subject: 'String'
term: 'Term'
title: 'String'
year: 'Int'
}
CoursePreference: { // field return type name
id: 'CourseID'
preference: 'Int'
}
CourseSection: { // field return type name
CourseID: 'CourseID'
capacity: 'Int'
endDate: 'Date'
hoursPerWeek: 'Float'
meetingTimes: 'MeetingTime'
professors: 'User'
sectionNumber: 'String'
startDate: 'Date'
}
CreateUserMutationResult: { // field return type name
message: 'String'
password: 'String'
success: 'Boolean'
username: 'String'
}
Error: { // field return type name
errors: 'Error'
message: 'String'
}
MeetingTime: { // field return type name
day: 'Day'
endTime: 'Date'
startTime: 'Date'
}
Mutation: { // field return type name
changeUserPassword: 'Response'
createTeachingPreference: 'Response'
createUser: 'CreateUserMutationResult'
generateSchedule: 'Response'
login: 'AuthPayload'
logout: 'AuthPayload'
resetPassword: 'ResetPasswordMutationResult'
updateSchedule: 'UpdateScheduleResponse'
updateUser: 'UpdateUserMutationResult'
}
Query: { // field return type name
allUsers: 'User'
coursePreferences: 'CoursePreference'
courses: 'CourseSection'
findUserById: 'User'
me: 'User'
schedule: 'Schedule'
survey: 'TeachingPreferenceSurvey'
}
ResetPasswordMutationResult: { // field return type name
message: 'String'
password: 'String'
success: 'Boolean'
}
Response: { // field return type name
message: 'String'
success: 'Boolean'
}
Schedule: { // field return type name
courses: 'CourseSection'
createdAt: 'Date'
id: 'ID'
year: 'Int'
}
TeachingPreferenceSurvey: { // field return type name
courses: 'CoursePreference'
}
UpdateScheduleResponse: { // field return type name
errors: 'String'
message: 'String'
success: 'Boolean'
}
UpdateUserMutationResult: { // field return type name
errors: 'Error'
user: 'User'
}
User: { // field return type name
active: 'Boolean'
id: 'Int'
name: 'String'
password: 'String'
preferences: 'CoursePreference'
role: 'Role'
username: 'String'
}
}
export interface NexusGenArgTypes {
Mutation: {
changeUserPassword: { // args
input: NexusGenInputs['ChangeUserPasswordInput']; // ChangeUserPasswordInput!
}
createTeachingPreference: { // args
input: NexusGenInputs['CreateTeachingPreferenceInput']; // CreateTeachingPreferenceInput!
}
createUser: { // args
input: NexusGenInputs['CreateUserInput']; // CreateUserInput!
}
generateSchedule: { // args
input: NexusGenInputs['GenerateScheduleInput']; // GenerateScheduleInput!
}
login: { // args
password: string; // String!
username: string; // String!
}
resetPassword: { // args
id: string; // ID!
}
updateSchedule: { // args
input: NexusGenInputs['UpdateScheduleInput']; // UpdateScheduleInput!
}
updateUser: { // args
input: NexusGenInputs['UpdateUserInput']; // UpdateUserInput!
}
}
Query: {
courses: { // args
term?: NexusGenEnums['Term'] | null; // Term
year?: number | null; // Int
}
findUserById: { // args
id: number; // Int!
}
schedule: { // args
year?: number | null; // Int
}
}
Schedule: {
courses: { // args
term: NexusGenEnums['Term']; // Term!
}
}
}
export interface NexusGenAbstractTypeMembers {
}
export interface NexusGenTypeInterfaces {
}
export type NexusGenObjectNames = keyof NexusGenObjects;
export type NexusGenInputNames = keyof NexusGenInputs;
export type NexusGenEnumNames = keyof NexusGenEnums;
export type NexusGenInterfaceNames = never;
export type NexusGenScalarNames = keyof NexusGenScalars;
export type NexusGenUnionNames = never;
export type NexusGenObjectsUsingAbstractStrategyIsTypeOf = never;
export type NexusGenAbstractsUsingStrategyResolveType = never;
export type NexusGenFeaturesConfig = {
abstractTypeStrategies: {
isTypeOf: false
resolveType: true
__typename: false
}
}
export interface NexusGenTypes {
context: Context;
inputTypes: NexusGenInputs;
rootTypes: NexusGenRootTypes;
inputTypeShapes: NexusGenInputs & NexusGenEnums & NexusGenScalars;
argTypes: NexusGenArgTypes;
fieldTypes: NexusGenFieldTypes;
fieldTypeNames: NexusGenFieldTypeNames;
allTypes: NexusGenAllTypes;
typeInterfaces: NexusGenTypeInterfaces;
objectNames: NexusGenObjectNames;
inputNames: NexusGenInputNames;
enumNames: NexusGenEnumNames;
interfaceNames: NexusGenInterfaceNames;
scalarNames: NexusGenScalarNames;
unionNames: NexusGenUnionNames;
allInputTypes: NexusGenTypes['inputNames'] | NexusGenTypes['enumNames'] | NexusGenTypes['scalarNames'];
allOutputTypes: NexusGenTypes['objectNames'] | NexusGenTypes['enumNames'] | NexusGenTypes['unionNames'] | NexusGenTypes['interfaceNames'] | NexusGenTypes['scalarNames'];
allNamedTypes: NexusGenTypes['allInputTypes'] | NexusGenTypes['allOutputTypes']
abstractTypes: NexusGenTypes['interfaceNames'] | NexusGenTypes['unionNames'];
abstractTypeMembers: NexusGenAbstractTypeMembers;
objectsUsingAbstractStrategyIsTypeOf: NexusGenObjectsUsingAbstractStrategyIsTypeOf;
abstractsUsingStrategyResolveType: NexusGenAbstractsUsingStrategyResolveType;
features: NexusGenFeaturesConfig;
}
declare global {
interface NexusGenPluginTypeConfig<TypeName extends string> {
}
interface NexusGenPluginInputTypeConfig<TypeName extends string> {
}
interface NexusGenPluginFieldConfig<TypeName extends string, FieldName extends string> {
/**
* Authorization for an individual field. Returning "true"
* or "Promise<true>" means the field can be accessed.
* Returning "false" or "Promise<false>" will respond
* with a "Not Authorized" error for the field.
* Returning or throwing an error will also prevent the
* resolver from executing.
*/
authorize?: FieldAuthorizeResolver<TypeName, FieldName>
}
interface NexusGenPluginInputFieldConfig<TypeName extends string, FieldName extends string> {
}
interface NexusGenPluginSchemaConfig {
}
interface NexusGenPluginArgConfig {
}
}