File tree 2 files changed +5
-5
lines changed
2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -15,17 +15,16 @@ import invariant from '../../jsutils/invariant';
15
15
import suggestionList from '../../jsutils/suggestionList' ;
16
16
import quotedOrList from '../../jsutils/quotedOrList' ;
17
17
import * as Kind from '../../language/kinds' ;
18
- import type { GraphQLType } from '../../type/definition' ;
19
18
20
19
21
20
export function unknownArgMessage (
22
21
argName : string ,
23
22
fieldName : string ,
24
- type : GraphQLType ,
23
+ typeName : string ,
25
24
suggestedArgs : Array < string >
26
25
) : string {
27
26
let message = `Unknown argument "${ argName } " on field "${ fieldName } " of ` +
28
- `type "${ String ( type ) } ".` ;
27
+ `type "${ typeName } ".` ;
29
28
if ( suggestedArgs . length ) {
30
29
message += ` Did you mean ${ quotedOrList ( suggestedArgs ) } ?` ;
31
30
}
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import type { ValidationContext } from '../index';
12
12
import { GraphQLError } from '../../error' ;
13
13
import { doTypesOverlap } from '../../utilities/typeComparators' ;
14
14
import { typeFromAST } from '../../utilities/typeFromAST' ;
15
+ import { isCompositeType } from '../../type/definition' ;
15
16
import type { GraphQLType } from '../../type/definition' ;
16
17
17
18
@@ -44,8 +45,8 @@ export function PossibleFragmentSpreads(context: ValidationContext): any {
44
45
InlineFragment ( node ) {
45
46
const fragType = context . getType ( ) ;
46
47
const parentType = context . getParentType ( ) ;
47
- if ( fragType &&
48
- parentType &&
48
+ if ( isCompositeType ( fragType ) &&
49
+ isCompositeType ( parentType ) &&
49
50
! doTypesOverlap ( context . getSchema ( ) , fragType , parentType ) ) {
50
51
context . reportError ( new GraphQLError (
51
52
typeIncompatibleAnonSpreadMessage ( parentType , fragType ) ,
You can’t perform that action at this time.
0 commit comments