Skip to content

Use context option (if provided) - #19

Merged
syrusakbary merged 1 commit into
graphql-python:masterfrom
luisincrespo:master
Dec 14, 2016
Merged

syrusakbary merged 1 commit into
graphql-python:masterfrom
luisincrespo:master

Conversation

@luisincrespo

@luisincrespo luisincrespo commented Dec 6, 2016 •

Copy link
Copy Markdown
Contributor

Related to #18

Currently, the GraphQLView class accepts the context keyword argument when initializing, but it's not using it to set the context_value when executing the query.

This PR modifies the get_context instance method inside GraphQLView so that the context option is used when it is provided, defaulting to request otherwise.

@coveralls

coveralls commented Dec 7, 2016 •

Copy link
Copy Markdown

Coverage Status

Coverage remained the same at 96.026% when pulling 31de8cc on luisincrespo:master into d42846e on graphql-python:master.

@syrusakbary

Copy link
Copy Markdown
Member

@luisincrespo Thanks for the PR! Any tests checking this change would be great so the issue is not repeated in the future :)

@luisincrespo

Copy link
Copy Markdown
Contributor Author

@syrusakbary of course, will do as soon as I get the time today

@syrusakbary
syrusakbary merged commit 021e9a2 into graphql-python:master Dec 14, 2016
@MrOrz

MrOrz commented Aug 8, 2017

Copy link
Copy Markdown

The context option became useless again in the master branch.

The commit that makes context option useless:
d728f80

Seems that users are forced to subclass GraphQLView and override get_context in order to customize context for now?

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

Successfully merging this pull request may close these issues.

4 participants