-
Notifications
You must be signed in to change notification settings - Fork 734
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
Doesn't support a fragment with the same name of its type #184
Comments
@martijnwalraven any thoughts on where the cause of this issue can be? I mean, it is a I'm trying to figure out to see if I can contribute fixing it up, but I'm a little lost on the project :P if you can provide any info for me to track this bug it would be very helpful. |
The problem is not actually the fragment name being the same as the name of the type it is defined on, but the name of the query field being the same. In the generated code, we expect So we need to disambiguate the fragments struct reference in the generated code. The relevant |
Hi 👋🏻 - after looking at this issue again in preparation for the upcoming 1.0 release we've decided not to take this request into 1.0. If this is important to you please let us know in this issue - thank you. |
With migrating our project to Apollo 1.x, this topic of naming the fragment the same as it's type came up again, but with a different problem. It results in a duplicated file name because of the Schema/Objects containing the same file name as the Fragments folder. |
As we've discovered discussing in Apollo Slack, If I create a fragment with the same name of its type as the following:
Everytime we call it from a query the query returns a
QueryName.Data.Center
type, even if wemap
and access it through the.fragments.center
property of each result item.The text was updated successfully, but these errors were encountered: