Skip to content

Commit 408b9bc

Browse files
committed
Improved variables
1 parent dcc20a9 commit 408b9bc

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/graphql_server/http/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@ class GraphQLRequestData:
6767
def to_template_context(self) -> dict[str, Any]:
6868
return {
6969
"query": tojson(self.query),
70-
"variables": tojson(self.variables),
70+
"variables": tojson(
71+
tojson(self.variables) if self.variables is not None else ""
72+
),
7173
"operation_name": tojson(self.operation_name),
7274
}
7375

src/graphql_server/static/graphiql.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@
194194
plugins: [explorerPlugin],
195195
inputValueDeprecation: true,
196196
query: {{query}},
197-
variables: '{{variables}}',
197+
variables: {{variables}},
198198
headers: parameters.headers,
199199
operationName: {{operation_name}},
200200
defaultQuery: EXAMPLE_QUERY,

0 commit comments

Comments
 (0)