@@ -65,7 +65,7 @@ export type GraphQLType =
65
65
| GraphQLList < any >
66
66
| GraphQLNonNull < any > ;
67
67
68
- export function isType ( type : unknown ) : boolean % checks {
68
+ export function isType ( type : unknown ) : boolean {
69
69
return (
70
70
isScalarType ( type ) ||
71
71
isObjectType ( type ) ||
@@ -89,8 +89,7 @@ export function assertType(type: unknown): GraphQLType {
89
89
* There are predicates for each kind of GraphQL type.
90
90
*/
91
91
92
- declare function isScalarType ( type : unknown ) : boolean % checks ( type instanceof
93
- GraphQLScalarType ) ;
92
+ declare function isScalarType ( type : unknown ) : boolean ;
94
93
// eslint-disable-next-line no-redeclare
95
94
export function isScalarType ( type ) {
96
95
return instanceOf ( type , GraphQLScalarType ) ;
@@ -103,8 +102,7 @@ export function assertScalarType(type: unknown): GraphQLScalarType {
103
102
return type ;
104
103
}
105
104
106
- declare function isObjectType ( type : unknown ) : boolean % checks ( type instanceof
107
- GraphQLObjectType ) ;
105
+ declare function isObjectType ( type : unknown ) : boolean ;
108
106
// eslint-disable-next-line no-redeclare
109
107
export function isObjectType ( type ) {
110
108
return instanceOf ( type , GraphQLObjectType ) ;
@@ -117,8 +115,7 @@ export function assertObjectType(type: unknown): GraphQLObjectType {
117
115
return type ;
118
116
}
119
117
120
- declare function isInterfaceType ( type : unknown ) : boolean % checks ( type instanceof
121
- GraphQLInterfaceType ) ;
118
+ declare function isInterfaceType ( type : unknown ) : boolean ;
122
119
// eslint-disable-next-line no-redeclare
123
120
export function isInterfaceType ( type ) {
124
121
return instanceOf ( type , GraphQLInterfaceType ) ;
@@ -133,8 +130,7 @@ export function assertInterfaceType(type: unknown): GraphQLInterfaceType {
133
130
return type ;
134
131
}
135
132
136
- declare function isUnionType ( type : unknown ) : boolean % checks ( type instanceof
137
- GraphQLUnionType ) ;
133
+ declare function isUnionType ( type : unknown ) : boolean ;
138
134
// eslint-disable-next-line no-redeclare
139
135
export function isUnionType ( type ) {
140
136
return instanceOf ( type , GraphQLUnionType ) ;
@@ -147,8 +143,7 @@ export function assertUnionType(type: unknown): GraphQLUnionType {
147
143
return type ;
148
144
}
149
145
150
- declare function isEnumType ( type : unknown ) : boolean % checks ( type instanceof
151
- GraphQLEnumType ) ;
146
+ declare function isEnumType ( type : unknown ) : boolean ;
152
147
// eslint-disable-next-line no-redeclare
153
148
export function isEnumType ( type ) {
154
149
return instanceOf ( type , GraphQLEnumType ) ;
@@ -161,8 +156,7 @@ export function assertEnumType(type: unknown): GraphQLEnumType {
161
156
return type ;
162
157
}
163
158
164
- declare function isInputObjectType ( type : unknown ) : boolean % checks ( type instanceof
165
- GraphQLInputObjectType ) ;
159
+ declare function isInputObjectType ( type : unknown ) : boolean ;
166
160
// eslint-disable-next-line no-redeclare
167
161
export function isInputObjectType ( type ) {
168
162
return instanceOf ( type , GraphQLInputObjectType ) ;
@@ -177,8 +171,7 @@ export function assertInputObjectType(type: unknown): GraphQLInputObjectType {
177
171
return type ;
178
172
}
179
173
180
- declare function isListType ( type : unknown ) : boolean % checks ( type instanceof
181
- GraphQLList ) ;
174
+ declare function isListType ( type : unknown ) : boolean ;
182
175
// eslint-disable-next-line no-redeclare
183
176
export function isListType ( type ) {
184
177
return instanceOf ( type , GraphQLList ) ;
@@ -191,8 +184,7 @@ export function assertListType(type: unknown): GraphQLList<any> {
191
184
return type ;
192
185
}
193
186
194
- declare function isNonNullType ( type : unknown ) : boolean % checks ( type instanceof
195
- GraphQLNonNull ) ;
187
+ declare function isNonNullType ( type : unknown ) : boolean ;
196
188
// eslint-disable-next-line no-redeclare
197
189
export function isNonNullType ( type ) {
198
190
return instanceOf ( type , GraphQLNonNull ) ;
@@ -220,7 +212,7 @@ export type GraphQLInputType =
220
212
| GraphQLList < GraphQLInputType > ,
221
213
> ;
222
214
223
- export function isInputType ( type : unknown ) : boolean % checks {
215
+ export function isInputType ( type : unknown ) : boolean {
224
216
return (
225
217
isScalarType ( type ) ||
226
218
isEnumType ( type ) ||
@@ -255,7 +247,7 @@ export type GraphQLOutputType =
255
247
| GraphQLList < GraphQLOutputType > ,
256
248
> ;
257
249
258
- export function isOutputType ( type : unknown ) : boolean % checks {
250
+ export function isOutputType ( type : unknown ) : boolean {
259
251
return (
260
252
isScalarType ( type ) ||
261
253
isObjectType ( type ) ||
@@ -278,7 +270,7 @@ export function assertOutputType(type: unknown): GraphQLOutputType {
278
270
*/
279
271
export type GraphQLLeafType = GraphQLScalarType | GraphQLEnumType ;
280
272
281
- export function isLeafType ( type : unknown ) : boolean % checks {
273
+ export function isLeafType ( type : unknown ) : boolean {
282
274
return isScalarType ( type ) || isEnumType ( type ) ;
283
275
}
284
276
@@ -297,7 +289,7 @@ export type GraphQLCompositeType =
297
289
| GraphQLInterfaceType
298
290
| GraphQLUnionType ;
299
291
300
- export function isCompositeType ( type : unknown ) : boolean % checks {
292
+ export function isCompositeType ( type : unknown ) : boolean {
301
293
return isObjectType ( type ) || isInterfaceType ( type ) || isUnionType ( type ) ;
302
294
}
303
295
@@ -315,7 +307,7 @@ export function assertCompositeType(type: unknown): GraphQLCompositeType {
315
307
*/
316
308
export type GraphQLAbstractType = GraphQLInterfaceType | GraphQLUnionType ;
317
309
318
- export function isAbstractType ( type : unknown ) : boolean % checks {
310
+ export function isAbstractType ( type : unknown ) : boolean {
319
311
return isInterfaceType ( type ) || isUnionType ( type ) ;
320
312
}
321
313
@@ -422,7 +414,7 @@ export class GraphQLNonNull<T extends GraphQLNullableType> {
422
414
423
415
export type GraphQLWrappingType = GraphQLList < any > | GraphQLNonNull < any > ;
424
416
425
- export function isWrappingType ( type : unknown ) : boolean % checks {
417
+ export function isWrappingType ( type : unknown ) : boolean {
426
418
return isListType ( type ) || isNonNullType ( type ) ;
427
419
}
428
420
@@ -445,7 +437,7 @@ export type GraphQLNullableType =
445
437
| GraphQLInputObjectType
446
438
| GraphQLList < any > ;
447
439
448
- export function isNullableType ( type : unknown ) : boolean % checks {
440
+ export function isNullableType ( type : unknown ) : boolean {
449
441
return isType ( type ) && ! isNonNullType ( type ) ;
450
442
}
451
443
@@ -478,7 +470,7 @@ export type GraphQLNamedType =
478
470
| GraphQLEnumType
479
471
| GraphQLInputObjectType ;
480
472
481
- export function isNamedType ( type : unknown ) : boolean % checks {
473
+ export function isNamedType ( type : unknown ) : boolean {
482
474
return (
483
475
isScalarType ( type ) ||
484
476
isObjectType ( type ) ||
@@ -986,7 +978,7 @@ export type GraphQLArgument = {
986
978
astNode : Maybe < InputValueDefinitionNode > ,
987
979
} ;
988
980
989
- export function isRequiredArgument ( arg : GraphQLArgument ) : boolean % checks {
981
+ export function isRequiredArgument ( arg : GraphQLArgument ) : boolean {
990
982
return isNonNullType ( arg . type ) && arg . defaultValue === undefined ;
991
983
}
992
984
@@ -1573,7 +1565,7 @@ export type GraphQLInputField = {
1573
1565
1574
1566
export function isRequiredInputField (
1575
1567
field : GraphQLInputField ,
1576
- ) : boolean % checks {
1568
+ ) : boolean {
1577
1569
return isNonNullType ( field . type ) && field . defaultValue === undefined ;
1578
1570
}
1579
1571
0 commit comments