From 4e3cc2bc05469eb4ecd435edb4c7c06af36d46d5 Mon Sep 17 00:00:00 2001 From: James Date: Mon, 14 Sep 2020 21:04:02 -0400 Subject: [PATCH] comments out breaking graphql errors --- src/graphql/index.js | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/graphql/index.js b/src/graphql/index.js index 249fb1677e..8cf77d16d0 100644 --- a/src/graphql/index.js +++ b/src/graphql/index.js @@ -71,30 +71,30 @@ class GraphQL { mutation, }); - this.errorExtensions = []; - this.errorExtensionIteration = 0; + // this.errorExtensions = []; + // this.errorExtensionIteration = 0; - this.extensions = async (info) => { - const { result } = info; - if (result.errors) { - const afterErrorHook = typeof this.config.hooks.afterError === 'function' ? this.config.hooks.afterError : null; - this.errorExtensions = await errorHandler(info, this.config.debug, afterErrorHook); - } - return null; - }; + // this.extensions = async (info) => { + // const { result } = info; + // if (result.errors) { + // const afterErrorHook = typeof this.config.hooks.afterError === 'function' ? this.config.hooks.afterError : null; + // this.errorExtensions = await errorHandler(info, this.config.debug, afterErrorHook); + // } + // return null; + // }; } init(req, res) { return graphQLHTTP({ schema: this.schema, - customFormatErrorFn: () => { - const response = { - ...this.errorExtensions[this.errorExtensionIteration], - }; - this.errorExtensionIteration += 1; - return response; - }, - extensions: this.extensions, + // customFormatErrorFn: () => { + // const response = { + // ...this.errorExtensions[this.errorExtensionIteration], + // }; + // this.errorExtensionIteration += 1; + // return response; + // }, + // extensions: this.extensions, context: { req, res }, }); }