File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change 7
7
* @flow strict
8
8
*/
9
9
10
+ import isPromise from './jsutils/isPromise' ;
10
11
import { validateSchema } from './type/validate' ;
11
12
import { parse } from './language/parser' ;
12
13
import { validate } from './validation/validate' ;
@@ -175,7 +176,7 @@ export function graphqlSync(
175
176
) ;
176
177
177
178
// Assert that the execution was synchronous.
178
- if ( result . then ) {
179
+ if ( isPromise ( result ) ) {
179
180
throw new Error ( 'GraphQL execution failed to complete synchronously.' ) ;
180
181
}
181
182
Original file line number Diff line number Diff line change 8
8
*/
9
9
10
10
import invariant from '../jsutils/invariant' ;
11
+ import isPromise from '../jsutils/isPromise' ;
11
12
import { type GraphQLSchema } from '../type/schema' ;
12
13
import { execute } from '../execution/execute' ;
13
14
import { parse } from '../language/parser' ;
@@ -32,6 +33,6 @@ export function introspectionFromSchema(
32
33
) : IntrospectionQuery {
33
34
const queryAST = parse ( getIntrospectionQuery ( options ) ) ;
34
35
const result = execute ( schema , queryAST ) ;
35
- invariant ( ! result . then && ! result . errors && result . data ) ;
36
+ invariant ( ! isPromise ( result ) && ! result . errors && result . data ) ;
36
37
return ( result . data : any ) ;
37
38
}
You can’t perform that action at this time.
0 commit comments