AssertionError: Found different types with the same name in the schema: ...
See original GitHub issueI know this has been submitted a million times, and I know there are several solutions BUT, despite all things it seems there still isn’t a way to actually know where the duplicates come from, e.g. The error message would read:
AssertionError: Found different types with the same name in the schema: status, status.
But that doesn’t give much information as to where do they come from. This is specially frustrating when plugging in projects. A suggestion would be to print the canonical name of the class the type is based on? something like ‘my_module.types.ProblematicType’.
Anyway, this issue arises specifically because I defined a Type based on an Enum on my types module and I’m using that everywhere, but still graphql complains about different types having the same name. I double checked and I don’t even use that name anywhere in my project, so it must be a conflicting dependency, but which one? where is that type being defined? The only way to know would be unplugging all dependencies and start plugging them one by one to find the offenders but this would be so inefficient and frankly, very stupid.
(in case you wonder I also searched in my site-packages
and found nothing, so it must be auto generated somewhere…)
I’m using these packages: django==2.2.9 graphene-django==2.7.1 graphene==2.1.8
And my types worked just fine with these versions: django==2.1.5 graphene-django==2.2.0 graphene==2.1.3
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (3 by maintainers)
Top GitHub Comments
The solution
@jkimbo this didn’t work for me the one that worked was adding
convert_choices_to_enum = False
in the metaclass of the ObjectType. here is the link https://docs.graphene-python.org/projects/django/en/latest/queries/#choices-to-enum-conversionwhen is this going to be merged and pushed?