React-apollo: SSR ERROR not pass down to children `renderToStringWithData`

Created on 9 May 2018  ·  4Comments  ·  Source: apollographql/react-apollo

Error on renderToStringWithData error data can't reach to components on SSR. Even If i apply errorPolicy: "all".

Intended outcome: this.props.data.error=error_data

Actual outcome:this.props.data.error= undefined

How to reproduce the issue: Try server rendering with a query(component) return any error on graphql resolver.

Version

Most helpful comment

@adamesque, these are separate problems.

1781, is about errors not being cached and thus losing the ability to handle them when mounting and remounting components.

This one is about the fact that getDataFromTree and renderToStringWithData throw an error when any error occurs, even when errorPolicy is set to all.

615 has more detail.

All 4 comments

Dup of #1781

@adamesque Its also not working with default errorPolicy.

@adamesque, these are separate problems.

1781, is about errors not being cached and thus losing the ability to handle them when mounting and remounting components.

This one is about the fact that getDataFromTree and renderToStringWithData throw an error when any error occurs, even when errorPolicy is set to all.

615 has more detail.

I've opened a PR to fix the inaccurate documentation around error cacheing in Apollo. https://github.com/apollographql/apollo-client/pull/4237

Was this page helpful?
0 / 5 - 0 ratings