-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fragment not deduplicated by client
preset
#8670
Comments
Thanks for creating this issue for us! I'm curious to ask if you have any pointers for how someone could start looking into diagnosing this issue? I've no experience contributing to this repo but this issue is becoming a bit of a blocker for me so am open to helping if I can 🙏 |
Ah amazing, sorry I missed your PR! Thanks for the pointer to this line of code, I noticed that we're currently able to override that at the codegen config level: 'src/graphql/': {
documents: ['src/**/*.tsx', '!src/graphql'],
preset: 'client',
plugins: [],
presetConfig: {
fragmentMasking: { unmaskFunctionName: 'getFragmentData' }
},
config: {
dedupeFragments: true, // <- added this and it works 🎉
}
}, Curious if this is could be helped by documentation, as looking at: https://the-guild.dev/graphql/codegen/plugins/presets/preset-client#config-api it wasn't clear to me we had the option of applying these additional config overrides. |
Fixed in #8971 |
Hey 👋 I have also encountered this issue, and it's a bit of a potential blocker so I'm hopeful we can resolve it. I've created a minimal repro here: https://codesandbox.io/s/focused-silence-flkogf
It is a very minimal repro but I think shows the essence of the issue. If you run
npm run start
, the GraphQL query is printed showing two instances of the exampleSharedComponentFragment
fragments I included. This is essentially how my query looks when seeing the error at the network levelThere can only be one fragment named 'X'
, so hopefully serves as a suitable reproduction — let me know if not though!Originally posted by @lrholmes in #8617 (reply in thread)
The text was updated successfully, but these errors were encountered: