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.

Use Lazy Query not rendering the correct data

See original GitHub issue

Intended outcome: When using useLazyQuery, the correct data is not being rendered but the network tab shows that it retrieves the correct data Screenshot 2022-09-26 at 20 56 28

Actual outcome:

Instead it renders the first array across the multiple arrays, duplicating the data Screenshot 2022-09-26 at 20 57 46

How to reproduce the issue:

Versions

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
dylanwulfcommented, Sep 27, 2022

I think your problem is that the id field is null. If id is nullable then I would recommend changing your keyFields to something else.

1reaction
LuisChiejcommented, Sep 27, 2022

Solved, @dylanwulf, Thank you very much

Read more comments on GitHub >

github_iconTop Results From Across the Web

useLazyQuery is called on every re-render if we change the ...
I've re-read the doc, I think this is a bug. The whole point of useLazyQuery is executing queries in response to events other...
Read more >
useLazyQuery - Re-Rendering Issue - Stack Overflow
I want to call the query the 1st time automatically in useEffect and then manually in the functions. Issue: Invarient Violation: Too many...
Read more >
Queries - Apollo GraphQL Docs
When your component renders, useQuery returns an object from Apollo Client that contains loading , error , and data properties you can use...
Read more >
You probably don't need useLazyQuery ‍♂️
My team maintains a pretty simple (React/Apollo) page that displays a list of items filtered and sorted by various values with corresponding ...
Read more >
useLazyLoadQuery - Relay
After a component using useLazyLoadQuery has committed, re-rendering/updating the component will not cause the query to be fetched again. If the component is...
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