@@ -7,14 +7,14 @@ import type {
7
7
ASTNode ,
8
8
NamedTypeNode ,
9
9
DirectiveNode ,
10
- OperationTypeNode ,
11
10
ObjectTypeDefinitionNode ,
12
11
ObjectTypeExtensionNode ,
13
12
InterfaceTypeDefinitionNode ,
14
13
InterfaceTypeExtensionNode ,
15
14
UnionTypeDefinitionNode ,
16
15
UnionTypeExtensionNode ,
17
16
} from '../language/ast' ;
17
+ import { OperationTypeNode } from '../language/ast' ;
18
18
19
19
import { isEqualType , isTypeSubTypeOf } from '../utilities/typeComparators' ;
20
20
@@ -120,7 +120,8 @@ function validateRootTypes(context: SchemaValidationContext): void {
120
120
`Query root type must be Object type, it cannot be ${ inspect (
121
121
queryType ,
122
122
) } .`,
123
- getOperationTypeNode ( schema , 'query' ) ?? ( queryType as any ) . astNode ,
123
+ getOperationTypeNode ( schema , OperationTypeNode . QUERY ) ??
124
+ ( queryType as any ) . astNode ,
124
125
) ;
125
126
}
126
127
@@ -129,7 +130,8 @@ function validateRootTypes(context: SchemaValidationContext): void {
129
130
context . reportError (
130
131
'Mutation root type must be Object type if provided, it cannot be ' +
131
132
`${ inspect ( mutationType ) } .` ,
132
- getOperationTypeNode ( schema , 'mutation' ) ?? ( mutationType as any ) . astNode ,
133
+ getOperationTypeNode ( schema , OperationTypeNode . MUTATION ) ??
134
+ ( mutationType as any ) . astNode ,
133
135
) ;
134
136
}
135
137
@@ -138,7 +140,7 @@ function validateRootTypes(context: SchemaValidationContext): void {
138
140
context . reportError (
139
141
'Subscription root type must be Object type if provided, it cannot be ' +
140
142
`${ inspect ( subscriptionType ) } .` ,
141
- getOperationTypeNode ( schema , 'subscription' ) ??
143
+ getOperationTypeNode ( schema , OperationTypeNode . SUBSCRIPTION ) ??
142
144
( subscriptionType as any ) . astNode ,
143
145
) ;
144
146
}
0 commit comments