-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
DuplicateNamesError on a field when upgrading to 1.13 #3949
Comments
Hi! sorry for the trouble. This usually happens when the same field is defined more than once. In 1.12, the second field definition would overwrite the first one. But in 1.13, GraphQL-Ruby supports multiple definitions for the same field, but requires some way to distinguish between them. When it can't tell the two definitions apart, it raises this error. If that's not enough info to track down the problem, could you please share the source for |
Oh my bad sorry, it comes from dry-graphql: https://github.com/ianks/dry-graphql/blob/master/lib/dry/graphql.rb. Well, I can't find a second definition for this field unfortunately so i am indeed unable to track down correctly the source of the problem :/ |
Thanks for sharing that link. I looked through the code, but I couldn't quite make enough sense of it to figure out why it might make a schema that defined the same field twice. I can think of a couple next steps:
|
Thanks for your answer, I'll try to investigate myself into dry-graphql to find out why it creates two same fields. |
I hope you got to the bottom of it. Let me know if there's anything else to investigate on the GraphQL side! |
Describe the bug
When upgrading to 1.13.0, I get
Found two visible definitions for 'Events__titletransferred.quantity'
but it doesn't seem to be right since in older version (1.12.16) I do not get this error. This type is created fromDry::Struct.graphql_type
which comes from this class:Inherited classes do not implement a quantity attribute so i do not understand this error message (it seems to do this for all my events implementing a quantity attribute). I've seen a similar issue (#3919) but it was with mutation types and i tried running
all_types
methods to see the arguments of this gql type but i didn't manage to put a pry at the correct location to try this out.Versions
graphql
version: 1.13.0rails
(or other framework): 6.1.4.4Hope you can help me out! Thank you
The text was updated successfully, but these errors were encountered: