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

Add execution_context_class argument in Flask GraphQLView #77

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions graphql_server/flask/graphqlview.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class GraphQLView(View):
schema = None
root_value = None
context = None
execution_context_class = None
pretty = False
graphiql = False
graphiql_version = None
Expand Down Expand Up @@ -73,6 +74,9 @@ def get_context(self):
def get_middleware(self):
return self.middleware

def get_execution_context_class(self):
return self.execution_context_class

def dispatch_request(self):
try:
request_method = request.method.lower()
Expand All @@ -95,6 +99,7 @@ def dispatch_request(self):
root_value=self.get_root_value(),
context_value=self.get_context(),
middleware=self.get_middleware(),
execution_context_class=self.get_execution_context_class(),
)
result, status_code = encode_execution_results(
execution_results,
Expand Down