File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -84,7 +84,7 @@ def dispatch_request(self):
8484 data = self .parse_body (request )
8585 is_batch = isinstance (data , list )
8686
87- show_graphiql = not is_batch and self .graphiql and self . can_display_graphiql (data )
87+ show_graphiql = not is_batch and self .should_display_graphiql (data )
8888
8989 if not is_batch :
9090 assert isinstance (data , dict ), "GraphQL params should be a dict. Received {}." .format (data )
@@ -271,12 +271,13 @@ def json_encode(data, pretty=False):
271271 separators = (',' , ': ' )
272272 )
273273
274- @ classmethod
275- def can_display_graphiql ( cls , data ) :
276- return 'raw' not in data and cls . request_wants_html ()
274+ def should_display_graphiql ( self , data ):
275+ if not self . graphiql or 'raw' in data :
276+ return False
277277
278- @classmethod
279- def request_wants_html (cls ):
278+ return self .request_wants_html ()
279+
280+ def request_wants_html (self ):
280281 best = request .accept_mimetypes \
281282 .best_match (['application/json' , 'text/html' ])
282283 return best == 'text/html' and \
You can’t perform that action at this time.
0 commit comments