From 60bf0f9f24a3803d289e36b281b3c55afbdadd34 Mon Sep 17 00:00:00 2001 From: James Gatz Date: Thu, 13 Oct 2022 16:53:51 +0200 Subject: [PATCH] parse the query variables correctly (#5273) --- .../src/ui/components/editors/body/graph-ql-editor.tsx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/packages/insomnia/src/ui/components/editors/body/graph-ql-editor.tsx b/packages/insomnia/src/ui/components/editors/body/graph-ql-editor.tsx index 5fa9be05b..59ebc0e6a 100644 --- a/packages/insomnia/src/ui/components/editors/body/graph-ql-editor.tsx +++ b/packages/insomnia/src/ui/components/editors/body/graph-ql-editor.tsx @@ -509,12 +509,9 @@ export const GraphQLEditor: FC = ({ } catch (err) { body = { query: '' }; } - let maybeVariables; - if (typeof body.variables === 'string') { - maybeVariables = jsonParseOr(body.variables, ''); - } + const query = body.query || ''; - const variables = jsonPrettify(JSON.stringify(maybeVariables)); + const variables = jsonPrettify(JSON.stringify(body.variables)); const variableTypes = buildVariableTypes(schema); // Create portal for GraphQL Explorer