File tree 3 files changed +7
-6
lines changed
3 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ declare module 'graphql' {
31
31
32
32
const queryType : GraphQLObjectType = new GraphQLObjectType ( {
33
33
name : 'Query' ,
34
- fields : {
34
+ fields : ( ) => ( {
35
35
sayHi : {
36
36
type : GraphQLString ,
37
37
args : {
@@ -47,7 +47,7 @@ const queryType: GraphQLObjectType = new GraphQLObjectType({
47
47
someFieldExtension : example ,
48
48
} ,
49
49
} ,
50
- } ,
50
+ } ) ,
51
51
extensions : {
52
52
someObjectExtension : example ,
53
53
} ,
Original file line number Diff line number Diff line change @@ -263,7 +263,9 @@ export function getNamedType(type: GraphQLType): GraphQLNamedType;
263
263
* Used while defining GraphQL types to allow for circular references in
264
264
* otherwise immutable type definitions.
265
265
*/
266
- export type Thunk < T > = ( ( ) => T ) | T ;
266
+ export type Thunk < T extends { [ key : string ] : any } | Array < any > > =
267
+ | ( ( ) => T )
268
+ | T ;
267
269
268
270
/**
269
271
* Custom extensions
Original file line number Diff line number Diff line change @@ -511,10 +511,9 @@ export function getNamedType(type) {
511
511
* Used while defining GraphQL types to allow for circular references in
512
512
* otherwise immutable type definitions.
513
513
*/
514
- export type Thunk < + T > = ( ( ) => T ) | T ;
514
+ export type Thunk < + T : ObjMap < any > | Array < any > > = ( ( ) => T ) | T ;
515
515
516
- function resolveThunk < + T > ( thunk : Thunk < T > ) : T {
517
- // $FlowFixMe[incompatible-use]
516
+ function resolveThunk < + T : ObjMap < any > | Array < any >> ( thunk : Thunk < T > ) : T {
518
517
return typeof thunk = = = 'function' ? thunk ( ) : thunk ;
519
518
}
520
519
You can’t perform that action at this time.
0 commit comments