Skip to content
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

Warnings are being emitted if you have multiple fragments of the same name for different servers #810

Open
Tri125 opened this issue Nov 2, 2023 · 0 comments

Comments

@Tri125
Copy link

Tri125 commented Nov 2, 2023

Warning: fragment with name Cake already exists.
graphql-tag enforces all fragment names across your application to be unique; read more about
this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names

My application is communicating with different graphql servers, their graphs are not related but they use similarly named types and fields, leading to similarly named fragments.

Is there a mechanism to scope the detection so that fragment "Cake" for server A doesn't generate a warning when there's a fragment "Cake" for server B?

I can work around it by renaming the fragments (CakeA, CakeB) which is less than ideal but I'm wondering if that's a use case that's been thought over.

Calling disableFragmentWarnings(); is undesirable as I still want to be warned if 2 fragments named "Cake" are both defined for the same server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant