react-apollo-hooks icon indicating copy to clipboard operation
react-apollo-hooks copied to clipboard

Network error is not reported in errors and loading stays true

Open shlomokraus opened this issue 8 years ago • 6 comments

When useing useQuery (with suspense false), I get a network error, but the hook state stays with "loading: true" and errors undefined. networkState is still 1.

shlomokraus avatar Dec 04 '18 14:12 shlomokraus

You can use errorPolicy=all as a workaround. I guess the problem is that subscription error handler not passed here https://github.com/trojanowski/react-apollo-hooks/blob/master/src/index.js#L31

avocadowastaken avatar Dec 20 '18 07:12 avocadowastaken

I have exactly the same issue as @shlomokraus described. Changing errorPolicy='all' doesn't make any difference - I tried to set that for individual query and globally in ApolloClient level. With <Suspense> it works as expected. I'm using version 0.2.1.

mateusznowosielski avatar Dec 23 '18 00:12 mateusznowosielski

@mateusznowosielski can you check https://npmjs.com/@dc0de/react-apollo-hooks, it's published version of #42.

avocadowastaken avatar Dec 23 '18 10:12 avocadowastaken

Thanks @umidbekkarimov this is very helpful. Error gets properly handled, I also checked the skip option and I like the new typescript aspect. Hope it gets merged.

mateusznowosielski avatar Dec 24 '18 21:12 mateusznowosielski

I think it will be merged soon - I'm going to review it tomorrow.

trojanowski avatar Dec 27 '18 18:12 trojanowski

Hello, any news on this issue?

cescox avatar Sep 12 '19 08:09 cescox