Skip to content
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

'AnonymousObservable' object has no attribute 'errors' #2

Closed
mlugowska opened this issue Feb 14, 2018 · 6 comments
Closed

'AnonymousObservable' object has no attribute 'errors' #2

mlugowska opened this issue Feb 14, 2018 · 6 comments

Comments

@mlugowska
Copy link

Hi. I need to add subscriptions to my graphene-django project. But I've landed with the following error: 'AnonymousObservable' object has no attribute 'errors' raised in graphene_django/views.py", line 164, in get_response. Have you met this error before? Or do you have any thoughts how can it be resolved?

@eamigo86
Copy link
Owner

eamigo86 commented Feb 19, 2018

Hello @mlugowska, sorry for delay. Could you show me your route definition of graphql in your urls.py file?

@dionyself
Copy link

@eamigo86
Copy link
Owner

eamigo86 commented Feb 23, 2018

Hi @dionyself, thanks for sharing your urls.py, the graphene_django_extras package provides two special views that you should use to avoid this error, try this:

# urls.py
from graphene_django_extras.views import AuthenticatedGraphQLView, ExtraGraphQLView

urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^accounts/login/$', django.contrib.auth.views.login),

    # Private url
    url(r'^graphql', AuthenticatedGraphQLView.as_view(graphiql=True))),

    # Public url
    # url(r'^graphql', ExtraGraphQLView.as_view(graphiql=True))),
]

You can also inherit these views to create your own

@dionyself
Copy link

Thanks, the problem is solved.

@xDHILEx
Copy link

xDHILEx commented Aug 11, 2018

I'm still receiving this error. https://github.com/xDHILEx/gdetest/

@anzaHanza
Copy link

anzaHanza commented Oct 27, 2018

I am reciving error 'AnonymousObservable' object has no attribute 'errors' in graph ql but socket connection works.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants