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.

Bug - use query is repeatly called when init component

See original GitHub issue

I’ve attached here the bug I am using

 "@apollo/client": "^3.0.0-beta.50"
Screenshot 2020-05-29 at 14 49 18 Screenshot 2020-05-29 at 14 50 49

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
unutoiulcommented, Jun 1, 2020

the issue is when you setup

defaultOptions: {
        watchQuery: {
            fetchPolicy: 'network-only',
        },
    },

the version . “@apollo/client”: “^3.0.0-beta.50” doesn’t trigger onCompleted function anymore…

ANY Idea was is BROKEN?

is breaking all my project can Apollo CLIENT TEAM FIX THOSE ISSUES ?

2reactions
bengal75commented, May 31, 2020

I am also running into this, using 3.0.0-beta.53. It happens immediately when using useQuery, but also happens once the query function has been called when using useLazyQuery. I’ve gone back to 3.0.0-beta.45 for now which doesn’t seem to have the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

useQuery | TanStack Query Docs
The function that the query will use to request data. Receives a QueryFunctionContext; Must return a promise that will either resolve data or...
Read more >
UseEffect being called multiple times - Stack Overflow
Your useEffect is executed only once per render cycle, but you have several state updates in your useEffect which cause a re-render.
Read more >
What I learned from React-Query, and why I won't use it again
We think that such a process should not be managed within the component. It affects the entire app, even beyond (the Iframe), and...
Read more >
Fetching data with queries | Full-Stack Quickstart
This component passes our GET_LAUNCHES query to useQuery and obtains data , loading , and error properties from the result. Depending on the...
Read more >
Using Suspense and React Query: Tutorial with examples
React Suspense simplifies managing loading states in React components, supporting fallbacks in case the component hasn't finished loading ...
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