-
Notifications
You must be signed in to change notification settings - Fork 787
useQuery's error
object disappears on rerender
#3295
Comments
Hi @hartbeatnt, what version of |
I am using 0.1.0-beta.11 |
@hartbeatnt Can you try with |
Hi @hwillson - We're seeing this (or, at least, a similar issue) intermittently manifest in tests using MockedProvider. I've put together a reproduction here: https://github.com/Geit/apollo-error-rerender-repro |
Thanks for the repro @Geit - I'll take a look! |
I do currently work around this bug by using |
This issue was fixed by #3339, which will be included in the next release. Thanks all! |
…3362) * Add test to verify error is persisted on re-render, when appropriate Issue #3295 demonstrates a problem where errors aren't maintained on re-renders, when they should still be available. This issue was fixed by PR #3339, but this commit will add an extra test to verify that the issue is indeed fixed. Fixes #3295. * Changelog update
@hwillson I am still experiencing this problem with v3.0.1 when using the Query component, here is a reproduction: https://codesandbox.io/s/wdu8j |
@dylanwulf @hwillson I am experiencing this error on using Can you re open this issue ? "@apollo/react-hooks": "3.1.3", |
@kartikjain26 please open a new issue with a runnable reproduction showing
the problem
…On Thu, Jan 30, 2020, 4:54 AM Kartik Jain ***@***.***> wrote:
@dylanwulf <https://github.com/dylanwulf> I am experiencing this error on
using useQuery. error property is undefined after intial render.
Can you re open this issue ?
***@***.***/react-hooks": "3.1.3",
"react-apollo": "2.5.8",
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#3295?email_source=notifications&email_token=ACTYZS525ELLNSJLNBB4JTTRAKPW5A5CNFSM4IILMDQ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEKKMJIY#issuecomment-580175011>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACTYZS4FC2TBRIL7XVYZURDRAKPW5ANCNFSM4IILMDQQ>
.
|
@kartikjain26 Just noticed the package versions you posted. You should not be using |
@dylanwulf This is occurring once in 30-40 times I try. Will post a recording or Screenshot if I manage to capture it. |
Because react-apollo is a wrapper package that contains
@apollo/react-hooks (as well as @apollo/react-components and
@apollo/react-hoc). So you have two different versions of
@apollo/react-hooks installed. One of them contains the fix for this bug
and the other does not.
…On Fri, Jan 31, 2020, 1:44 AM Kartik Jain ***@***.***> wrote:
@dylanwulf <https://github.com/dylanwulf> This is occurring once in 30-40
times I try. Will post a recording or Screenshot if I manage to capture it.
Also, why should not we use @apollo/react-hooks and react-apollo at the
same time ?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#3295?email_source=notifications&email_token=ACTYZS4YRIOBK46WL2GJ2UTRAPCDRA5CNFSM4IILMDQ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEKNVNZI#issuecomment-580605669>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACTYZS3ZFTYJ4ICIZTKRIX3RAPCDRANCNFSM4IILMDQQ>
.
|
Intended outcome:
Error object for failed query should persist across rerenders
Actual outcome:
The error object disappears after rerendering
How to reproduce the issue:
@apollo/react-hooks
branch installedthere is an error
message. But once the timer expires and the Parent rerenders the child component, the error object will disappear and it will display "there is no error" without refiring the queryVersion
System:
OS: macOS 10.14.5
Binaries:
Node: 8.12.0 - /usr/local/bin/node
npm: 6.5.0 - ~/.npm-packages/bin/npm
Browsers:
Chrome: 75.0.3770.142
Safari: 12.1.1
npmPackages:
apollo-cache-inmemory: ^1.1.7 => 1.6.2
apollo-cache-persist: ^0.1.1 => 0.1.1
apollo-client: ^2.2.3 => 2.6.3
apollo-link: ^1.1.0 => 1.2.12
apollo-link-context: ^1.0.8 => 1.0.18
apollo-link-error: ^1.1.0 => 1.1.11
apollo-link-http: ^1.5.2 => 1.5.15
apollo-link-rest: ^0.2.4 => 0.2.4
apollo-link-retry: ^2.2.4 => 2.2.14
apollo-link-state: ^0.4.0 => 0.4.2
apollo-upload-client: ^8.1.0 => 8.1.0
react-apollo: ^2.1.4 => 2.5.8
=> also @apollo/react-hooks, but that doesn't log from the npx command
The text was updated successfully, but these errors were encountered: