From 53bf9781201d7762684b778946f20631b10a1fe9 Mon Sep 17 00:00:00 2001 From: lee Date: Mon, 14 Sep 2020 14:22:13 +0100 Subject: [PATCH] correcting catch --- subjects/graphql/index.html | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/subjects/graphql/index.html b/subjects/graphql/index.html index 4af70c6b..60e86fe6 100644 --- a/subjects/graphql/index.html +++ b/subjects/graphql/index.html @@ -26,12 +26,11 @@ headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(graphQLParams), }) - .then(response => response.json()) - .catch(() => response.text()); + .then(response => response.json().catch(() => response.text())) ReactDOM.render( React.createElement(GraphiQL, { fetcher: graphQLFetcher }), document.getElementById('graphiql'), - ); + ) \ No newline at end of file