Browse Source

correcting catch

content-update
lee 4 years ago
parent
commit
53bf978120
  1. 5
      subjects/graphql/index.html

5
subjects/graphql/index.html

@ -26,12 +26,11 @@
headers: { 'Content-Type': 'application/json' }, headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(graphQLParams), body: JSON.stringify(graphQLParams),
}) })
.then(response => response.json()) .then(response => response.json().catch(() => response.text()))
.catch(() => response.text());
ReactDOM.render( ReactDOM.render(
React.createElement(GraphiQL, { fetcher: graphQLFetcher }), React.createElement(GraphiQL, { fetcher: graphQLFetcher }),
document.getElementById('graphiql'), document.getElementById('graphiql'),
); )
</script> </script>
</body> </body>
</html> </html>
Loading…
Cancel
Save