Skip to content

Commit c9f436f

Browse files
authored
Refactor GraphQLView.should_display_graphiql()
Clarify and shorten GraphQLView.should_display_graphiql() by writing it as a conjunction of criteria.
1 parent 4183613 commit c9f436f

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

flask_graphql/graphqlview.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,7 @@ def parse_body(self):
141141
return {}
142142

143143
def should_display_graphiql(self):
144-
if not self.graphiql or 'raw' in request.args:
145-
return False
146-
147-
return self.request_wants_html()
144+
return self.graphiql and 'raw' not in request.args and self.request_wants_html()
148145

149146
def request_wants_html(self):
150147
best = request.accept_mimetypes \

0 commit comments

Comments
 (0)