File tree 2 files changed +9
-3
lines changed
2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change 2
2
3
3
import { SYMBOL_ITERATOR } from './symbols' ;
4
4
5
+ declare function arrayFrom < T > ( arrayLike : Iterable < T > ) : Array < T > ;
6
+ // eslint-disable-next-line no-redeclare
5
7
declare function arrayFrom < T : mixed > (
6
8
arrayLike : mixed ,
7
9
mapFn ?: ( elem : mixed , index : number ) => T ,
Original file line number Diff line number Diff line change @@ -13,6 +13,8 @@ import { type ASTVisitor } from '../../language/visitor';
13
13
import { type GraphQLSchema } from '../../type/schema' ;
14
14
import {
15
15
type GraphQLOutputType ,
16
+ type GraphQLObjectType ,
17
+ type GraphQLInterfaceType ,
16
18
isObjectType ,
17
19
isInterfaceType ,
18
20
isAbstractType ,
@@ -79,7 +81,9 @@ function getSuggestedTypeNames(
79
81
return [ ] ;
80
82
}
81
83
82
- const suggestedTypes = new Set ( ) ;
84
+ const suggestedTypes : Set <
85
+ GraphQLObjectType | GraphQLInterfaceType ,
86
+ > = new Set ( ) ;
83
87
const usageCount = Object . create ( null ) ;
84
88
for ( const possibleType of schema . getPossibleTypes ( type ) ) {
85
89
if ( ! possibleType . getFields ( ) [ fieldName ] ) {
@@ -111,10 +115,10 @@ function getSuggestedTypeNames(
111
115
}
112
116
113
117
// Suggest super types first followed by subtypes
114
- if ( isAbstractType ( typeA ) && schema . isSubType ( typeA , typeB ) ) {
118
+ if ( isInterfaceType ( typeA ) && schema . isSubType ( typeA , typeB ) ) {
115
119
return - 1 ;
116
120
}
117
- if ( isAbstractType ( typeB ) && schema . isSubType ( typeB , typeA ) ) {
121
+ if ( isInterfaceType ( typeB ) && schema . isSubType ( typeB , typeA ) ) {
118
122
return 1 ;
119
123
}
120
124
You can’t perform that action at this time.
0 commit comments