Skip to content

Commit 1b94fc8

Browse files
committed
Improved JSON dump
1 parent 258af89 commit 1b94fc8

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

flask_graphql/graphqlview.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,12 +164,15 @@ def format_execution_result(self, execution_result, id):
164164
return response, status_code
165165

166166
@staticmethod
167-
def json_encode(d, pretty=False):
167+
def json_encode(data, pretty=False):
168168
if not pretty:
169-
return json.dumps(d, separators=(',', ':'))
169+
return json.dumps(data, separators=(',', ':'))
170170

171-
return json.dumps(d, sort_keys=True,
172-
indent=2, separators=(',', ': '))
171+
return json.dumps(
172+
data,
173+
indent=2,
174+
separators=(',', ': ')
175+
)
173176

174177
# noinspection PyBroadException
175178
def parse_body(self, request):

0 commit comments

Comments
 (0)