-
Notifications
You must be signed in to change notification settings - Fork 765
fix: use execution_context_class attribute for GraphQLView #1398
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
fix: use execution_context_class attribute for GraphQLView #1398
Conversation
graphene_django/views.py
Outdated
@@ -112,7 +112,7 @@ def __init__( | |||
self.pretty = self.pretty or pretty | |||
self.graphiql = self.graphiql or graphiql | |||
self.batch = self.batch or batch | |||
self.execution_context_class = execution_context_class | |||
self.execution_context_class = execution_context_class or self.execution_context_class |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probs want to follow the same pattern as the other attributes (graphiql
, batch
etc):
self.execution_context_class = execution_context_class or self.execution_context_class | |
self.execution_context_class = self.execution_context_class or execution_context_class |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think so this is not a good pattern. class attribute it's something like default value. when we create an instance we need to have approach to redefine it. thats why i use current order.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Arfey Nice, thats a good point - could you update the other attributes to follow that pattern instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@Arfey great PR! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like you just need to run the pre-commit hook so that the formatter runs, nice one on the PR
…ython#1398) * fix: use execution_context_class attribute for GraphQLView
Simple change for using execution_context_class as class attribute