-
Notifications
You must be signed in to change notification settings - Fork 30
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
Cache returns incorrect data when using aliases on different fields with the same name #372
Comments
Thanks for the detailed example here! The trouble here is that hermes isn't currently aware of type unions (nor fragments with type conditions) :( So, when it sees the array there, it doesn't know to redirect fields for It looks like the second fragment is winning (without any warning or error!), and it's interpreting the query as if it were:
|
Until we support union types, I'm going to see if I can at least get an error in there to detect cases where fragments/queries disagree about field aliases |
…and also warnings about type constraints not being supported. |
Just as a note, I added a (skipped, failing) test to the repo a while back that reflects this behavior: 01c7b34 We should re-enable it when we want to fix this. |
Hi, we've noticed that when we use fragments to select different fields with the same name, Hermes does not behave correctly. It's easiest to illustrate with an example. This is from a black-box test I wrote around our cache:
And here's the test result:
This situation comes up when there are conflicting field types - e.g. we have some objects with a numeric ID, and others with a string ID. Using the
@static
annotation does work around the problem, but that's not possible in all cases.The text was updated successfully, but these errors were encountered: