From 7b416220af8eb6f42c45d7ef97535030327dd770 Mon Sep 17 00:00:00 2001 From: SeungWon Date: Wed, 12 Jul 2023 00:01:57 +0900 Subject: [PATCH] fix: Issue with incorrect OperationName applied on GraphQL request (#6074) * fix: Retained operation name in GraphQL requests * fix: Ensure Immediate Reflection of operationName Changes in GraphQL Query --- .../src/ui/components/editors/body/graph-ql-editor.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 f0901ed4b..60d4904e1 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 @@ -291,7 +291,11 @@ export const GraphQLEditor: FC = ({ } } - const content = getGraphQLContent(state.body, query); + if (!operationName) { + delete state.body.operationName; + } + + const content = getGraphQLContent(state.body, query, operationName); onChange(content); setState(state => ({