Skip to content
This repository was archived by the owner on Apr 13, 2023. It is now read-only.
This repository was archived by the owner on Apr 13, 2023. It is now read-only.

errorPolicy all behaves the same as ignore for server side rendering #2680

@ganemone

Description

@ganemone

I believe there is a bug with error handling in react-apollo when using server side rendering which causes the error field in a query result to be undefined, even when the errorPolicy is set to all.

Intended outcome:

When a <Query> component is server side renderered with errorPolicy=all, and an error thrown in a resolver, the render props function should be passed a result with an error field being populated as documented here.

Actual outcome:

The error field is undefined on the server.

How to reproduce the issue:

I have created a reproduction example here: https://codesandbox.io/s/3xx4w96o6

I also have a version on github here: https://github.com/ganemone/apollo-ssr-error-handling

Version

  • apollo-client@latest
  • react-apollo@latest

I believe this is a similar issue to #2655 and #615 however there was some issues with people being rude in those threads so I am creating a new issue here with more clear reproduction steps.

I think this should be somewhat high priority since there is not a viable errorPolicy for gracefully handling errors in server side rendering right now. none will cause renderToStringWithData to throw, and all behaves the same as ignore, so you are forced to either render a full error page or ignore errors completely.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions