Skip to content

Commit 67af841

Browse files
committed
falling back to using 'graphql-tag' import
1 parent 8c36c9c commit 67af841

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,4 +248,5 @@ There are many refinements and enhancements that would be beneficial, and contri
248248

249249
## Notes
250250

251-
This is development is not affiliated with either the [graphql-code-generator](https://graphql-code-generator.com/) team, the [Hasura](https://hasura.io/) team, or the [Apollo GraphQL](https://www.apollographql.com/) team.
251+
- This is development is not affiliated with either the [graphql-code-generator](https://graphql-code-generator.com/) team, the [Hasura](https://hasura.io/) team, or the [Apollo GraphQL](https://www.apollographql.com/) team.
252+
- graphql-code-generator only picking up gql from 'graphql-tag' import, and not the newer '@apollo/client' import. The 'graphql-tag' import will continue to be used until this is addressed, even for react-apollo v3.

demo/src/autogen/hasura/typescript.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
import { ApolloClient, FetchResult, MutationOptions } from '@apollo/client'
1+
import { ApolloClient } from '@apollo/client'
2+
import { FetchResult } from '@apollo/client'
3+
import { MutationOptions } from '@apollo/client'
24
import { observationModelFieldsFragment } from './src/autogen';
35
import { InsertobservationModelMutation } from './src/autogen';
46
import { InsertobservationModelMutationVariables } from './src/autogen';

packages/graphql-codegen-hasura-gql/src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ export const plugin: PluginFunction<CstmHasuraCrudPluginConfig> = (schema: Graph
3232

3333
const importArray: string[] = [
3434
"/* eslint-disable @typescript-eslint/no-unused-vars */",
35-
`import gql from '${config.reactApolloVersion === 3 ? "@apollo/client" : "graphql-tag"}';`
35+
//`import gql from '${config.reactApolloVersion === 3 ? "@apollo/client" : "graphql-tag"}';` //graphql-code-generator still only picking up gql from 'graphql-tag' import. Will switch to "@apollo/client" import when this issue is addressed
36+
`import gql from 'graphql-tag';`
3637
];
3738
const contentArray: string[] = [];
3839

0 commit comments

Comments
 (0)