Skip to content
New issue

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

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

Already on GitHub? # to your account

Render an Apollo Error's response body during unsuccessful responses #1732

Closed
blakewilson opened this issue Jan 16, 2024 · 2 comments
Closed
Assignees
Labels
package: @faustwp/core Related to the Faust Core package

Comments

@blakewilson
Copy link
Contributor

When receiving an unsuccessful response in Faust via Apollo, an ApolloError will be thrown. For example, during a Next.js prerendering error:

Error occurred prerendering page "/en". Read more: https://nextjs.org/docs/messages/prerender-error
ApolloError: Response not successful: Received status code 500

at new ApolloError (/workspace/node_modules/@apollo/client/errors/errors.cjs:31:28)
at /workspace/node_modules/@apollo/client/core/core.cjs:1863:19
at both (/workspace/node_modules/@apollo/client/utilities/utilities.cjs:1072:53)
at /workspace/node_modules/@apollo/client/utilities/utilities.cjs:1065:72
at new Promise (<anonymous>)
at Object.then (/workspace/node_modules/@apollo/client/utilities/utilities.cjs:1065:24)
at Object.error (/workspace/node_modules/@apollo/client/utilities/utilities.cjs:1073:49)
at notifySubscription (/workspace/node_modules/zen-observable/lib/Observable.js:140:18)
at onNotify (/workspace/node_modules/zen-observable/lib/Observable.js:179:3)
at SubscriptionObserver.error (/workspace/node_modules/zen-observable/lib/Observable.js:240:7)

It would be helpful from a developer experience perspective to also show the response's body here, as they can determine further what the reason for the unsuccessful response was.

@github-project-automation github-project-automation bot moved this to 🆕 Backlog in Headless OSS Jan 16, 2024
@blakewilson blakewilson added the package: @faustwp/core Related to the Faust Core package label Jan 17, 2024
@mindctrl mindctrl moved this from 🆕 Backlog to 📋 Accepted in Headless OSS Feb 23, 2024
@mindctrl mindctrl moved this from 📋 Accepted to 🔖 Ready for Development in Headless OSS Feb 27, 2024
@theodesp theodesp moved this from 🔖 Ready for Development to 🏗 In progress in Headless OSS Mar 4, 2024
@theodesp theodesp self-assigned this Mar 4, 2024
@blakewilson blakewilson moved this from 🏗 In progress to 👀 In review in Headless OSS Mar 7, 2024
@TeresaGobble
Copy link
Contributor

Hi @theodesp , confirming that this is the corresponding PR: #1832

@mindctrl
Copy link
Contributor

mindctrl commented Mar 8, 2024

@TeresaGobble that's it. I'll link the PR to the issue now.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
package: @faustwp/core Related to the Faust Core package
Projects
Archived in project
Development

No branches or pull requests

5 participants