Skip to content

Commit 5fb5cd6

Browse files
authored
Refactored GraphiQL rendering
1 parent 2825345 commit 5fb5cd6

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

Diff for: flask_graphql/graphqlview.py

+8-3
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,13 @@ def get_middleware(self, request):
6060
def get_executor(self, request):
6161
return self.executor
6262

63+
def render_graphiql(self, **kwargs):
64+
return render_graphiql(
65+
graphiql_version=self.graphiql_version,
66+
graphiql_template=self.graphiql_template,
67+
**kwargs
68+
):
69+
6370
def dispatch_request(self):
6471
try:
6572
if request.method.lower() not in ('get', 'post'):
@@ -77,9 +84,7 @@ def dispatch_request(self):
7784

7885
if show_graphiql:
7986
query, variables, operation_name, id = self.get_graphql_params(request, data)
80-
return render_graphiql(
81-
graphiql_version=self.graphiql_version,
82-
graphiql_template=self.graphiql_template,
87+
return self.render_graphiql(
8388
query=query,
8489
variables=variables,
8590
operation_name=operation_name,

0 commit comments

Comments
 (0)