1
1
/* eslint-disable @typescript-eslint/no-empty-object-type */
2
2
import type { ReadStream } from 'node:fs'
3
- import * as graphqlTsSchema from '@graphql-ts/schema'
3
+ import * as tsgql from '@graphql-ts/schema'
4
4
// @ts -expect-error
5
5
import GraphQLUpload from 'graphql-upload/GraphQLUpload.js'
6
6
import type { GraphQLFieldExtensions , GraphQLResolveInfo } from 'graphql'
@@ -48,7 +48,7 @@ export { fields, interface, interfaceField, object, union } from './schema-api-w
48
48
type SomeTypeThatIsntARecordOfArgs = string
49
49
export type FieldFuncResolve <
50
50
Source ,
51
- Args extends { [ Key in keyof Args ] : graphqlTsSchema . Arg < graphqlTsSchema . InputType > } ,
51
+ Args extends { [ Key in keyof Args ] : tsgql . Arg < tsgql . InputType > } ,
52
52
Type extends OutputType ,
53
53
Key extends string ,
54
54
Context extends KeystoneContext < any >
@@ -65,30 +65,30 @@ export type FieldFuncResolve<
65
65
// });
66
66
[ Key ] extends [ keyof Source ]
67
67
? Source [ Key ] extends
68
- | graphqlTsSchema . InferValueFromOutputType < Type >
68
+ | tsgql . InferValueFromOutputType < Type >
69
69
| ( (
70
- args : graphqlTsSchema . InferValueFromArgs < Args > ,
70
+ args : tsgql . InferValueFromArgs < Args > ,
71
71
context : Context ,
72
72
info : GraphQLResolveInfo
73
- ) => graphqlTsSchema . InferValueFromOutputType < Type > )
73
+ ) => tsgql . InferValueFromOutputType < Type > )
74
74
? {
75
- resolve ?: graphqlTsSchema . FieldResolver <
75
+ resolve ?: tsgql . FieldResolver <
76
76
Source ,
77
77
SomeTypeThatIsntARecordOfArgs extends Args ? { } : Args ,
78
78
Type ,
79
79
Context
80
80
>
81
81
}
82
82
: {
83
- resolve : graphqlTsSchema . FieldResolver <
83
+ resolve : tsgql . FieldResolver <
84
84
Source ,
85
85
SomeTypeThatIsntARecordOfArgs extends Args ? { } : Args ,
86
86
Type ,
87
87
Context
88
88
>
89
89
}
90
90
: {
91
- resolve : graphqlTsSchema . FieldResolver <
91
+ resolve : tsgql . FieldResolver <
92
92
Source ,
93
93
SomeTypeThatIsntARecordOfArgs extends Args ? { } : Args ,
94
94
Type ,
@@ -98,7 +98,7 @@ export type FieldFuncResolve<
98
98
99
99
type FieldFuncArgs <
100
100
Source ,
101
- Args extends { [ Key in keyof Args ] : graphqlTsSchema . Arg < graphqlTsSchema . InputType > } ,
101
+ Args extends { [ Key in keyof Args ] : tsgql . Arg < tsgql . InputType > } ,
102
102
Type extends OutputType ,
103
103
Key extends string ,
104
104
Context extends KeystoneContext
@@ -115,15 +115,15 @@ type FieldFunc = <
115
115
Type extends OutputType ,
116
116
Key extends string ,
117
117
Context extends KeystoneContext < any > ,
118
- Args extends { [ Key in keyof Args ] : graphqlTsSchema . Arg < graphqlTsSchema . InputType > } = object
118
+ Args extends { [ Key in keyof Args ] : tsgql . Arg < tsgql . InputType > } = object
119
119
> (
120
120
field : FieldFuncArgs < Source , Args , Type , Key , Context >
121
- ) => graphqlTsSchema . Field < Source , Args , Type , Key , Context >
121
+ ) => tsgql . Field < Source , Args , Type , Key , Context >
122
122
123
123
export const field = fieldd as FieldFunc
124
124
// TODO: remove when we use { graphql } from '.keystone'
125
125
126
- export const JSON = graphqlTsSchema . g . scalar < JSONValue > (
126
+ export const JSON = tsgql . graphql . scalar < JSONValue > (
127
127
new GraphQLScalarType ( {
128
128
name : 'JSON' ,
129
129
description :
@@ -140,13 +140,13 @@ type FileUpload = {
140
140
createReadStream ( ) : ReadStream
141
141
}
142
142
143
- export const Upload = graphqlTsSchema . g . scalar < Promise < FileUpload > > ( GraphQLUpload )
143
+ export const Upload = tsgql . graphql . scalar < Promise < FileUpload > > ( GraphQLUpload )
144
144
145
145
// - Decimal.js throws on invalid inputs
146
146
// - Decimal.js can represent +Infinity and -Infinity, these aren't values in Postgres' decimal,
147
147
// NaN is but Prisma doesn't support it
148
148
// .isFinite refers to +Infinity, -Infinity and NaN
149
- export const Decimal = graphqlTsSchema . graphql . scalar < DecimalValue & { scaleToPrint ?: number } > (
149
+ export const Decimal = tsgql . graphql . scalar < DecimalValue & { scaleToPrint ?: number } > (
150
150
new GraphQLScalarType ( {
151
151
name : 'Decimal' ,
152
152
serialize ( value ) {
@@ -174,7 +174,7 @@ export const Decimal = graphqlTsSchema.graphql.scalar<DecimalValue & { scaleToPr
174
174
} )
175
175
)
176
176
177
- export const BigInt = graphqlTsSchema . graphql . scalar < bigint > (
177
+ export const BigInt = tsgql . graphql . scalar < bigint > (
178
178
new GraphQLScalarType ( {
179
179
name : 'BigInt' ,
180
180
serialize ( value ) {
@@ -209,7 +209,7 @@ function parseDate (input: string): Date {
209
209
return parsed
210
210
}
211
211
212
- export const DateTime = graphqlTsSchema . g . scalar < Date > (
212
+ export const DateTime = tsgql . graphql . scalar < Date > (
213
213
new GraphQLScalarType ( {
214
214
name : 'DateTime' ,
215
215
specifiedByURL : 'https://datatracker.ietf.org/doc/html/rfc3339#section-5.6' ,
@@ -243,7 +243,7 @@ function validateCalendarDay (input: string) {
243
243
}
244
244
}
245
245
246
- export const CalendarDay = graphqlTsSchema . g . scalar < string > (
246
+ export const CalendarDay = tsgql . graphql . scalar < string > (
247
247
new GraphQLScalarType ( {
248
248
name : 'CalendarDay' ,
249
249
specifiedByURL : 'https://datatracker.ietf.org/doc/html/rfc3339#section-5.6' ,
@@ -270,7 +270,7 @@ export const CalendarDay = graphqlTsSchema.g.scalar<string>(
270
270
} )
271
271
)
272
272
273
- export const Empty = graphqlTsSchema . g . scalar (
273
+ export const Empty = tsgql . graphql . scalar (
274
274
new GraphQLScalarType ( {
275
275
name : 'Empty' ,
276
276
serialize ( value ) { return null } ,
@@ -280,40 +280,40 @@ export const Empty = graphqlTsSchema.g.scalar(
280
280
)
281
281
282
282
export type NullableType < Context extends KeystoneContext = KeystoneContext > =
283
- graphqlTsSchema . NullableType < Context >
284
- export type Type < Context extends KeystoneContext = KeystoneContext > = graphqlTsSchema . Type < Context >
283
+ tsgql . NullableType < Context >
284
+ export type Type < Context extends KeystoneContext = KeystoneContext > = tsgql . Type < Context >
285
285
export type NullableOutputType < Context extends KeystoneContext = KeystoneContext > =
286
- graphqlTsSchema . NullableOutputType < Context >
286
+ tsgql . NullableOutputType < Context >
287
287
export type OutputType < Context extends KeystoneContext = KeystoneContext > =
288
- graphqlTsSchema . OutputType < Context >
288
+ tsgql . OutputType < Context >
289
289
export type Field <
290
290
Source ,
291
- Args extends Record < string , graphqlTsSchema . Arg < any > > ,
291
+ Args extends Record < string , tsgql . Arg < any > > ,
292
292
TType extends OutputType < Context > ,
293
293
Key extends string ,
294
294
Context extends KeystoneContext = KeystoneContext
295
- > = graphqlTsSchema . Field < Source , Args , TType , Key , Context >
295
+ > = tsgql . Field < Source , Args , TType , Key , Context >
296
296
export type FieldResolver <
297
297
Source ,
298
- Args extends Record < string , graphqlTsSchema . Arg < any > > ,
298
+ Args extends Record < string , tsgql . Arg < any > > ,
299
299
TType extends OutputType < Context > ,
300
300
Context extends KeystoneContext = KeystoneContext
301
- > = graphqlTsSchema . FieldResolver < Source , Args , TType , Context >
301
+ > = tsgql . FieldResolver < Source , Args , TType , Context >
302
302
export type ObjectType <
303
303
Source ,
304
304
Context extends KeystoneContext = KeystoneContext
305
- > = graphqlTsSchema . ObjectType < Source , Context >
305
+ > = tsgql . ObjectType < Source , Context >
306
306
export type UnionType <
307
307
Source ,
308
308
Context extends KeystoneContext = KeystoneContext
309
- > = graphqlTsSchema . UnionType < Source , Context >
309
+ > = tsgql . UnionType < Source , Context >
310
310
export type InterfaceType <
311
311
Source ,
312
- Fields extends Record < string , graphqlTsSchema . InterfaceField < any , OutputType < Context > , Context > > ,
312
+ Fields extends Record < string , tsgql . InterfaceField < any , OutputType < Context > , Context > > ,
313
313
Context extends KeystoneContext = KeystoneContext
314
- > = graphqlTsSchema . InterfaceType < Source , Fields , Context >
314
+ > = tsgql . InterfaceType < Source , Fields , Context >
315
315
export type InterfaceField <
316
- Args extends Record < string , graphqlTsSchema . Arg < any > > ,
316
+ Args extends Record < string , tsgql . Arg < any > > ,
317
317
TType extends OutputType < Context > ,
318
318
Context extends KeystoneContext = KeystoneContext
319
- > = graphqlTsSchema . InterfaceField < Args , TType , Context >
319
+ > = tsgql . InterfaceField < Args , TType , Context >
0 commit comments