Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output 'result' from apollo-link-http error #755

Merged
merged 1 commit into from
Jul 6, 2018

Conversation

skevy
Copy link
Contributor

@skevy skevy commented Jul 2, 2018

Fixes #652.

apollo-link-http will return a "result" object (if it can) inside its error object. This result object will have details from the GraphQL server about the error.

This PR adds simple logic to extractMessage to return that result JSON up to the UI.

It may be prudent in the future to add logic to extract data from the myriad of different Apollo Link errors (https://github.com/apollographql/apollo-link/blob/a79f47e8ae81ee2444d547315be61dbafea37dcb/packages/apollo-link-http-common/src/index.ts#L14-L29), but for now this should suffice.

@CLAassistant
Copy link

CLAassistant commented Jul 2, 2018

CLA assistant check
All committers have signed the CLA.

@timsuchanek
Copy link
Member

Thanks for the awesome PR!

@timsuchanek timsuchanek merged commit e2cf374 into graphql:master Jul 6, 2018
@skevy skevy deleted the skevy-more-detailed-errors branch July 6, 2018 16:46
cgxxv pushed a commit to cgxxv/graphql-playground that referenced this pull request Mar 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants