Apollo Client 3.6.+ running exceptions on Expo
See original GitHub issueuseQuery
和 useMutation
都无法正确执行。
Both useQuery
and useMutation
do not execute correctly.
在 Expo 上运行 Apollo Client 3.6.1 时,Android 模拟器无法正常运行,而 Web 可以,当我切换到 3.5.10 后,才能正常运行。
When I running Apollo Client 3.6.1 on Expo, It will not running properly in Android emulator but it can running in web, then I use 3.5.10, It works properly.
Intended outcome:
loading 总是 true,networkStatus 总是1,当我不停的将 fetchPolicy 注释和解开注释,它有可能正常运行,但似乎都是缓存的数据。对于 fetchPolicy,我尝试过 no-cache
,network-only
,cache-and-network
,都不能正常运行。
Loading always true and networkStatus always 1, but when I keep note code and unlock the note with fetchPolicy, it Probability of normal loading, but that seems to be the cached data. I try to set fetchPolicy to no-cache
, network-only
or cache-and-network
, it always not working properly
Actual outcome:
当 useQuery
正常运行时,loading 应该是 false,networkStatus 应该是 7.
How to reproduce the issue:
我是在学习 这个 时遇到的问题,或许你们可以尝试一下会不会遇到问题,我的代码在 https://github.com/ZZZCNY/Android-Application-Development-Fundamentals.git 可以看到。
I was learning this when I encountered the problem, maybe you can try to see if you will encounter the problem, my code is at https://github.com/ZZZCNY/ Android-Application-Development-Fundamentals.git can be seen.
Versions
Issue Analytics
- State:
- Created a year ago
- Reactions:6
- Comments:5 (1 by maintainers)
Top GitHub Comments
I was caught out by this originally – Expo running an apollo-client 3.6.x version. The web view of my Expo project was working fine, but my iOS was never loading any data and stuck on a loading state.
I’ve just run through all the versions since to give a breakdown. Pleased to say this issue for me has been resolved – thanks for your work on this.
✓ 3.5.10 (version I had to revert to) ⨯ 3.6.0 - web working, iOS not working ⨯ 3.6.1 - web working, iOS not working ⨯ 3.6.2 - web working, iOS not working ⨯ 3.6.3 - web working, iOS not working ✓ 3.6.4 ✓ 3.6.5 ✓ 3.6.6 ✓ 3.6.7 ✓ 3.6.8 (current)
Same here, the real network requests never get executed with useQuery or HOC/Components. 3.5.10 works correctly. Although, if I call client.query() directly then the network request gets executed correctly.