apollo-client icon indicating copy to clipboard operation
apollo-client copied to clipboard

promise.allSettled instead of promise.all consumeAndAwaitPromises

Open Ivan-Parushev opened this issue 4 years ago • 4 comments

When using the getDataFromThree method for SSR, if one query returns an error (even graphql errors like "user not authorized"), the whole SSR fails or is only partially rendered. With promise allSettled getDataFromThree will no longer break SSR because of single query. Connected issues: https://github.com/apollographql/react-apollo/issues/3678 https://github.com/apollographql/react-apollo/issues/1403

Ivan-Parushev avatar Jun 28 '20 07:06 Ivan-Parushev

@Ivan-Parushev: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Apollo Contributor License Agreement here: https://contribute.apollographql.com/

apollo-cla avatar Jun 28 '20 07:06 apollo-cla

If somebody can assist me with Circle CI error: "FAIL ./dist/apollo-client.cjs.min.js: 24.25KB > maxSize 24.25KB (gzip)" I only changed 1 line and max size is exceeded.

Ivan-Parushev avatar Jun 28 '20 07:06 Ivan-Parushev

@Ivan-Parushev If you rebase that failure will disappear. Definitely not your fault; we were just very close to the threshold.

benjamn avatar Jun 30 '20 18:06 benjamn

Hi, Just wondering if this change is still planned to make it into the codebase at some point? :-) I recently looked into the SSR implementation of a project I'm working on and I found the current behaviour where the entire SSR dataset is thrown away on any failure surprising, as my expectation was that a failure would only affect the request that the failure was in response to.

cysp avatar Nov 27 '20 01:11 cysp