question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Apollo Client 3.6.+ running exceptions on Expo

See original GitHub issue

useQueryuseMutation 都无法正确执行。

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-cachenetwork-onlycache-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:closed
  • Created a year ago
  • Reactions:6
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
nickmacavoycommented, Jun 21, 2022

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)

1reaction
martsaarmetscommented, May 5, 2022

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Advanced topics on caching in Apollo Client
This article describes special cases and considerations when using the Apollo Client cache. Bypassing the cache. Sometimes you shouldn't use the cache for...
Read more >
Handling Errors with Apollo Client (React) - YouTube
In this video I talk about handling errors when running queries and mutations using Apollo Client in a React project.Table of contents:00:00 ...
Read more >
GraphQL Code Libraries, Tools and Services
Apollo Client. GitHubapollographql/apollo-client ... Tests (jMeter) show that it is as fast or faster than other Go implementations for simple queries.
Read more >
GraphQL | RedwoodJS Docs
On the web side, Redwood uses Apollo Client by default though you can swap it out for something else if you want. The...
Read more >
@apollo/client - Awesome JS
Improvements (from CHANGELOG.md ). Only show dev tools suggestion in the console when connectToDevTools is true . @chris110408 in #10258.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found