-
When I generate types with Apollo client 3.0, I can use plugin option called /* src/generated/graphql.tsx */
import * as Apollo from '@apollo/client'; // This is not used, but it is generated automatically.
import * as ApolloReactHooks from '@apollo/client/react'; My configuration overwrite: true
schema: './schema.graphql'
documents: 'src/**/queries.ts'
generates:
src/generated/graphql.tsx:
plugins:
- 'typescript'
- 'typescript-operations'
- 'typescript-react-apollo'
config:
onlyOperationTypes: true
preResolveTypes: true
pureMagicComment: true
apolloReactHooksImportFrom: '@apollo/client/react'
gqlImport: 'graphql-tag'
withResultType: false |
Beta Was this translation helpful? Give feedback.
Answered by
ardatan
Mar 16, 2021
Replies: 1 comment
-
Your bundler (Webpack, rollup or whatever it is) will remove it automatically for sure. I don't think that import statement will remain unless it's used. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
dotansimha
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Your bundler (Webpack, rollup or whatever it is) will remove it automatically for sure. I don't think that import statement will remain unless it's used.