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.

Having multiple watchQuery observables on the page causes an inifite number of rapid requests

See original GitHub issue

v3.1.x of apollo client introduced an odd issue in our software where having multiple watchQuery observables on the page causes it to make 10s of http requests per second an infinite number of times.

Intended outcome: To make a single http request per watchQuery observable.

Actual outcome: 10s of requests are made to the server per second infinitely.

How to reproduce the issue: I’ve created a minimal reporoduction of the issue, note I’ve mocked the http request but the original issue was happenning with a real backend. https://stackblitz.com/edit/apollo-watch-query-infinite

Versions System: OS: Windows 10 10.0.18363 Binaries: Node: 12.13.1 - C:\Program Files\nodejs\node.EXE Yarn: 1.22.0 - ~\AppData\Roaming\npm\yarn.CMD npm: 6.12.1 - C:\Program Files\nodejs\npm.CMD Browsers: Chrome: 81.0.4044.92 Edge: Spartan (44.18362.449.0)

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:4
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
JesseZomercommented, Sep 11, 2020

https://github.com/apollographql/apollo-client/issues/6760#issuecomment-668188727 Here is some more info on something they changed in 3.1. If you set nextFetchPolicy: 'cache-first' it will stop.

I really think they should have communicated this a bit better, seeing the impact this can have on some servers

1reaction
dvakatsiienkocommented, Sep 3, 2020

Yes, I can confirm this issue but in a little bit different condition: using pollInterval, in case if multiple queries (pollInterval applied) are used on the same page. I have 8 queries (pollInterval applied) on the same page which gives me an infinite querying loop very quickly.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pagination and Infinite Scrolling in Apollo Client
In Apollo Client, watchQuery returns an observable that can be fed into the UI or other parts of an application interested in this...
Read more >
@apollo/client | Yarn - Package Manager
Apollo Client is a fully-featured caching GraphQL client with integrations for React, Angular, and more. It allows you to easily build UI components...
Read more >
Using GraphQL with Apollo Angular - Povio
Fast development speed. Growing documentation on its use. How to Set-Up Apollo GraphQL? There are many GraphQL client libraries available.
Read more >
query processing techniques: Topics by Science.gov
Processing SPARQL queries with regular expressions in RDF databases ... Applications of genomic studies are spreading rapidly in many domains of science and ......
Read more >
angular/angular - Gitter
what would cause my component that uses resolve in my routing to not ... .io/startbootstrap-sb-admin-2/pages/tables.html this dataTable looks with bold ...
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