summaryrefslogtreecommitdiff
path: root/source/github-helpers/api.ts
diff options
context:
space:
mode:
authorGravatar Vedant K <gamemaker0042@gmail.com> 2021-09-26 10:27:40 +0530
committerGravatar GitHub <noreply@github.com> 2021-09-26 11:57:40 +0700
commitfdd2e33dbc61675685eaa914f869c955a305764c (patch)
tree4602bddc1bd523e8bb8cc41d61a9e9e45964eef8 /source/github-helpers/api.ts
parent37fa4677f1ecf26d7176c8d9d43f8a4db6d5d902 (diff)
downloadrefined-github-fdd2e33dbc61675685eaa914f869c955a305764c.tar.gz
refined-github-fdd2e33dbc61675685eaa914f869c955a305764c.tar.zst
refined-github-fdd2e33dbc61675685eaa914f869c955a305764c.zip
Use safer saving mechanism in `restore-file` (#4803)
Co-authored-by: Federico Brigante <me@fregante.com>
Diffstat (limited to 'source/github-helpers/api.ts')
-rw-r--r--source/github-helpers/api.ts2
1 files changed, 1 insertions, 1 deletions
diff --git a/source/github-helpers/api.ts b/source/github-helpers/api.ts
index 17937968..e9ca80af 100644
--- a/source/github-helpers/api.ts
+++ b/source/github-helpers/api.ts
@@ -186,7 +186,7 @@ export const v4 = mem(async (
Authorization: `bearer ${personalToken}`,
},
method: 'POST',
- body: JSON.stringify({query: `{${query}}`}),
+ body: JSON.stringify({query: query.trimStart().startsWith('mutation') ? query : `{${query}}`}),
});
const apiResponse: GraphQLResponse = await response.json();