Add ability to pass execution_context_class to GraphQLView.as_view()#1109
Merged
zbyte64 merged 2 commits intographql-python:mainfrom Mar 31, 2021
Merged
Add ability to pass execution_context_class to GraphQLView.as_view()#1109zbyte64 merged 2 commits intographql-python:mainfrom
execution_context_class to GraphQLView.as_view()#1109zbyte64 merged 2 commits intographql-python:mainfrom
Conversation
Currently when passing `execution_context_class` like this: ``` GraphQLView.as_view(execution_context_class=CustomContext) ``` you get the following error from `View.as_view()` ``` TypeError: GraphQLView() received an invalid keyword 'execution_context_class'. as_view only accepts arguments that are already attributes of the class. ``` this PR fixes the `hasattr` check in `.as_view`. Fixes: graphql-python#1072
removed whitespace
Didericis
approved these changes
Feb 3, 2021
Collaborator
|
Great catch. Would like to add a test for this, let me know if you're up for it, otherwise we'll merge as is. |
Contributor
Author
|
Hi @zbyte64 thanks for looking at this. As you can see I am a bit strapped for time at this moment. Let's merge it as is. |
Contributor
Author
|
Is it possible to merge this in as is? |
|
This got me too. Can we have this released please? On a somewhat relevant note, per fail fast principle can we have |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently when passing
execution_context_classlike this:you get the following error from
View.as_view()this PR fixes the
hasattrcheck in.as_view.Fixes: #1072