AttributeError: type object 'User' has no attribute 'name'

schema-request
community-help

#1

Hi Guys

I’m new with graphene and I have this:

from django.contrib.auth.models import User

class UserType(DjangoObjectType):
    class Meta:
        model = User

Basically, using Django’s User class is giving me this error, because before using the django User class, I was using my own User definition and it worked. Why using the User class from the django authentication framework is giving me the error mentioned in the title:

File “/usr/local/lib/python3.6/site-packages/graphql/type/typemap.py”, line 60, in reducer
if type.name in map:
AttributeError: type object ‘User’ has no attribute ‘name’

Am I missing something?

Regards

PD: I’m using Django 2.0.4


#2

Hey @freddy311082, unfortunately I’m not familiar with Graphene. You may find more help on another board more focused on Graphene or Django. If you come across any questions specifically about our API though, feel free to leave another question :slight_smile: