-
Notifications
You must be signed in to change notification settings - Fork 183
Open
Description
Which packages are impacted by your issue?
@graphql-codegen/typescript-react-apollo
Describe the bug
When using @graphql-codegen with the typescript-react-apollo plugin and @apollo/client v4 the generated code is invalid. Generated hooks (e.g. useQuery / useMutation) must be imported from @apollo/client/react, but are imported through @apollo/client. This causes a generated file to compile.
A workaround is to manually specify the following in the codegen.ts file:
config: {
apolloReactCommonImportFrom: "@apollo/client/react",
apolloReactHooksImportFrom: "@apollo/client/react",
}Your Example Website or App
N/A
Steps to Reproduce the Bug or Issue
- Bump
@apollo/clientfrom v3 to v4 - Run
codegen - Build the generated code.
Expected behavior
The file does not compile and it is expected to compile.
Screenshots or Videos
No response
Platform
- OS: macOS
- NodeJS: v24
Codegen Config File
No response
Additional context
No response
mchoraine, Netail, giancarlosisasi, AELSchauer, EvgeniyKumachev and 5 more
Metadata
Metadata
Assignees
Labels
No labels