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.

Refetch triggers twice

See original GitHub issue

Intended outcome: refetch should always work correctly

Actual outcome: refetch sometimes triggers twice, one with the new variables (which is correct) and after that with the initial variables

How to reproduce the issue: i can not reproduce constantly, sometimes works ok, sometimes does not, i tried many things from using the old HOCs graphql to new react render-prop components, changing fetchPolicy and more

Versions latest

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:10
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

11reactions
peterpetrecommented, Nov 28, 2018

The issue was too serious for our company’s product, imagine our users sometimes couldnt use filter, search and load more… so we dropped apollo client and created our own version. Good luck!

3reactions
JamieKudlacommented, Jul 10, 2019

This is still an issue, but the “OP” was just closed #2285

Read more comments on GitHub >

github_iconTop Results From Across the Web

In Next.js, why does useQuery fetch data twice (once on the ...
So, it seems clear that it is fetching twice even though ssr is configured. If I set {ssr: false} in useQuery, it does...
Read more >
Apollo client fetchPolicy issues - query called twice
If I'm using one of cache-and-network or network-only fetch policies, one of the queries is called twice. This doesn't happen when I use ......
Read more >
Why is my fetch getting called twice? : r/reactjs - Reddit
It shows it getting called twice in the console, but only shows once rendered on the page. import React, { useEffect, useState }...
Read more >
useMutation | Vue Apollo
This ensures that query refetching does not hold up mutation response ... update : This function will be called twice over the lifecycle...
Read more >
React 18 useEffect Double Call for APIs: Emergency Fix
Here is why this works. The first time the useEffect is called the myFetch starts the fetch and stores the promise in the...
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