Skip to content

[Django][Auth] About GraphQLView and (not) AnonymousUser #625

Answered by rafalp
lorddaedra asked this question in Q&A
Discussion options

You must be logged in to vote

There are two things here:

There's indeed a bug with DEFAULT_PLAYGROUND_OPTIONS. Correct value would be:

DEFAULT_PLAYGROUND_OPTIONS = {"settings": {"request.credentials": "same-origin"}}

This bug can be worked around by defining this setting in your GraphQLView:

    path(
        'graphql/',
        GraphQLView.as_view(
            schema=schema,
            playground_options={
                "settings": {
                    "request.credentials": "include"
                }
            }
        ),
        name='graphql',
    ),

We've deprecated ariadne.contrib.django with plan to remove this code from Ariadne's codebase soonish, which makes fixing this in Ariadne counter-productive …

Replies: 4 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@lorddaedra
Comment options

@lorddaedra
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by lorddaedra
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #624 on July 11, 2021 13:49.