question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AssertionError: Found different types with the same name in the schema: ...

See original GitHub issue

I 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:closed
  • Created 4 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
NwawelAIroumecommented, May 30, 2022

The solution

@arielnmz you need to explicitly turn on the new naming scheme in v2.9.0: http://docs.graphene-python.org/projects/django/en/latest/settings/#django-choice-field-enum-v3-naming

@ulgens I agree the error message could be more helpful. Do you want to try and make a better one?

@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-conversion

1reaction
adrengifocommented, Mar 10, 2020

when is this going to be merged and pushed?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Different types with the same name in the schema - Django ...
AssertionError: Found different types with the same name in the schema: PageType, PageType. It seems that it is unable to inherit models ......
Read more >
AssertionError: Found different types with the same name in ...
I was having the same issue. In my particular case the issue is a conflict internal workings of SQLAlchemy when a backref is...
Read more >
AssertionError: Found different types with the same name in ...
I have two Classes Products and SalableProducts in my Models (SalableProducts inherits from Products so it has every field of it's database) ...
Read more >
Python Examples of graphene.Field - ProgramCreek.com
You may also want to check out all available functions/classes of the module ... AssertionError: Found different types # with the same name...
Read more >
How to use the graphene.ID function in graphene - Snyk
Failing to do this will result in a error like "AssertionError: Found # different types with the same name in the schema: VoteConnection,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found