File tree Expand file tree Collapse file tree
packages/plugins/typescript/graphql-request/tests Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { join } from 'path' ;
22import { remove , writeFile } from 'fs-extra' ;
3- import { parse } from 'graphql' ;
3+ // @ts -ignore
4+ import { OperationTypeNode , parse } from 'graphql' ;
45import { codegen } from '@graphql-codegen/core' ;
56import { mockGraphQLServer } from '@graphql-codegen/testing' ;
67import * as TypeScriptPlugin from '@graphql-codegen/typescript' ;
@@ -10,6 +11,16 @@ import * as GraphQLRequestPlugin from '../src/index.js';
1011
1112describe ( 'GraphQL Request Integration' , ( ) => {
1213 it ( 'should send requests correctly' , async ( ) => {
14+ // @ts -ignore
15+ if ( ! OperationTypeNode ) {
16+ // `OperationTypeNode` is a type in `graphql@15`, but it is a native TS enum in `graphql@16`.
17+ // `graphql-request@7` uses `OperationTypeNode` enum to analyse document.
18+ // So, `graphql-request@7` does not work with `graphql@15`.
19+ //
20+ // This block is a hacky way to skip running this test for `graphql@15`.
21+ return ;
22+ }
23+
1324 const sdkFileName = 'graphql-request-sdk.ts' ;
1425 const sdkFilePath = join ( __dirname , './test-files' , sdkFileName ) ;
1526 const typeDefs = parse ( /* GraphQL */ `
You can’t perform that action at this time.
0 commit comments