File tree 1 file changed +7
-6
lines changed
Filter options
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):
84
84
data = self .parse_body (request )
85
85
is_batch = isinstance (data , list )
86
86
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 )
88
88
89
89
if not is_batch :
90
90
assert isinstance (data , dict ), "GraphQL params should be a dict. Received {}." .format (data )
@@ -271,12 +271,13 @@ def json_encode(data, pretty=False):
271
271
separators = (',' , ': ' )
272
272
)
273
273
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
277
277
278
- @classmethod
279
- def request_wants_html (cls ):
278
+ return self .request_wants_html ()
279
+
280
+ def request_wants_html (self ):
280
281
best = request .accept_mimetypes \
281
282
.best_match (['application/json' , 'text/html' ])
282
283
return best == 'text/html' and \
You can’t perform that action at this time.
0 commit comments