dotansimha / graphql-code-generator

A tool for generating code based on a GraphQL schema and GraphQL operations (query/mutation/subscription), with flexible support for custom plugins.
https://the-guild.dev/graphql/codegen/
MIT License
10.86k stars 1.33k forks source link

import-types-preset with react-apollo #10143

Closed KamalAman closed 1 month ago

KamalAman commented 2 months ago

Which packages are impacted by your issue?

"@graphql-codegen/typescript-react-apollo": "4.3.2",
"@graphql-codegen/import-types-preset": "3.0.0",

Describe the bug

Using import-types-preset with react-apollo generated invalid files. The react-hook helpers are is prefix with Types.

Please reopen https://github.com/dotansimha/graphql-code-generator/issues/2742, or use this as the open bug ticket

The workaround is to split typescript-react-apollo away from typescript-operations. https://github.com/dotansimha/graphql-code-generator/issues/2742#issuecomment-542285543

Your Example Website or App

https://codesandbox.io/s/unruffled-goldwasser-hurx5

Steps to Reproduce the Bug or Issue

https://codesandbox.io/s/unruffled-goldwasser-hurx5

Expected behavior

Generated react-hook helpers should not prefix with Types.

Screenshots or Videos

No response

Platform

Codegen Config File

No response

Additional context

No response

eddeee888 commented 1 month ago

Hi @KamalAman , both @graphql-codegen/typescript-react-apollo and @graphql-codegen/import-types-preset are community packages that live in https://github.com/dotansimha/graphql-code-generator-community/ I think you would be able to get more help from posting the issue there 🙂