File tree 2 files changed +4
-5
lines changed 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -135,10 +135,9 @@ export type GraphQLLeafType =
135
135
GraphQLEnumType ;
136
136
137
137
export function isLeafType ( type : ?GraphQLType ) : boolean {
138
- const namedType = getNamedType ( type ) ;
139
138
return (
140
- namedType instanceof GraphQLScalarType ||
141
- namedType instanceof GraphQLEnumType
139
+ type instanceof GraphQLScalarType ||
140
+ type instanceof GraphQLEnumType
142
141
) ;
143
142
}
144
143
Original file line number Diff line number Diff line change 11
11
import type { ValidationContext } from '../index' ;
12
12
import { GraphQLError } from '../../error' ;
13
13
import type { FieldNode } from '../../language/ast' ;
14
- import { isLeafType } from '../../type/definition' ;
14
+ import { getNamedType , isLeafType } from '../../type/definition' ;
15
15
import type { GraphQLType } from '../../type/definition' ;
16
16
17
17
@@ -42,7 +42,7 @@ export function ScalarLeafs(context: ValidationContext): any {
42
42
Field ( node : FieldNode ) {
43
43
const type = context . getType ( ) ;
44
44
if ( type ) {
45
- if ( isLeafType ( type ) ) {
45
+ if ( isLeafType ( getNamedType ( type ) ) ) {
46
46
if ( node . selectionSet ) {
47
47
context . reportError ( new GraphQLError (
48
48
noSubselectionAllowedMessage ( node . name . value , type ) ,
You can’t perform that action at this time.
0 commit comments