From 9113a826ce2aa512b1231415c028372487d3a8d3 Mon Sep 17 00:00:00 2001 From: Andrew Bastin Date: Sun, 11 Oct 2020 13:15:39 -0400 Subject: [PATCH] Added temporary hack to fix GQL trailing space errors --- pages/graphql.vue | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pages/graphql.vue b/pages/graphql.vue index 3dcdb6bf9..24ae5e60d 100644 --- a/pages/graphql.vue +++ b/pages/graphql.vue @@ -612,7 +612,8 @@ export default { const res = await sendNetworkRequest(reqOptions, this.$store) - const responseText = new TextDecoder("utf-8").decode(res.data) + // HACK: Temporary trailing null character issue from the extension fix + const responseText = new TextDecoder("utf-8").decode(res.data).replace(/\0+$/, "") this.response = JSON.stringify(JSON.parse(responseText), null, 2) @@ -713,7 +714,8 @@ export default { const data = await sendNetworkRequest(reqOptions, this.$store) - const response = new TextDecoder("utf-8").decode(data.data) + // HACK : Temporary trailing null character issue from the extension fix + const response = new TextDecoder("utf-8").decode(data.data).replace(/\0+$/, "") const introspectResponse = JSON.parse(response) const schema = gql.buildClientSchema(introspectResponse.data)