File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change 12
12
*/
13
13
import { GraphQLError } from 'graphql/error/GraphQLError' ;
14
14
// @ts -ignore
15
- import { OperationDefinitionNode } from 'graphql/language' ;
15
+ import { DocumentNode , OperationDefinitionNode } from 'graphql/language' ;
16
16
import { print } from 'graphql/language/printer' ;
17
17
import { parse } from 'graphql/language/parser' ;
18
18
import Observable from 'zen-observable-ts' ;
@@ -203,9 +203,10 @@ export class GraphQLAPIClass {
203
203
*/
204
204
getGraphqlOperationType ( operation ) {
205
205
const doc = parse ( operation ) ;
206
- const {
207
- definitions : [ { operation : operationType } ] ,
208
- } = doc ;
206
+ const definitions = doc . definitions as ReadonlyArray <
207
+ OperationDefinitionNode
208
+ > ;
209
+ const [ { operation : operationType } ] = definitions ;
209
210
210
211
return operationType ;
211
212
}
@@ -294,7 +295,7 @@ export class GraphQLAPIClass {
294
295
} ;
295
296
296
297
const body = {
297
- query : print ( query ) ,
298
+ query : print ( query as DocumentNode ) ,
298
299
variables,
299
300
} ;
300
301
@@ -389,7 +390,7 @@ export class GraphQLAPIClass {
389
390
appSyncGraphqlEndpoint,
390
391
authenticationType,
391
392
apiKey,
392
- query : print ( query ) ,
393
+ query : print ( query as DocumentNode ) ,
393
394
region,
394
395
variables,
395
396
graphql_headers,
You can’t perform that action at this time.
0 commit comments