Use Lazy Query not rendering the correct data
See original GitHub issueIntended outcome: When using useLazyQuery, the correct data is not being rendered but the network tab shows that it retrieves the correct data
Actual outcome:
Instead it renders the first array across the multiple arrays, duplicating the data
How to reproduce the issue:
Versions
Issue Analytics
- State:
- Created a year ago
- Comments:5 (2 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think your problem is that the
id
field is null. Ifid
is nullable then I would recommend changing your keyFields to something else.Solved, @dylanwulf, Thank you very much