-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
query results are undefined during loading (due to breaking change in @apollo/client v3) #2640
Comments
Thank you for bringing this to our attention. I say we upgrade to |
Seems |
If that's just a matter of waiting Apollo to update you can probably quickfix in your codebase and let them fix it. Is there an action required from Vulcan in the long run? |
The Apollo breaking change is intentional and probably won't be fixed, in the sense of reverted to previous behavior, so I think Vulcan needs to change its codebase. I do not yet know if the suggested fix from Apollo comments ( |
Ok makes sense, I'll check that. In the meantime you can implement the "data/previousData" stuff locally with |
@eric-burel I am sorry, maybe I misunderstand what you are suggesting, but that would require changes in 30+ components in my own codebase and would be a big setback to productivity. |
Yeah makes sense indeed. I would be happy to merge the proposed change asap, it sounds relevant to me. |
What if we create a new setting |
|
Hey all, I was just wondering if you solved this, and if you did, what implementation did you use? We ran into the same issue and luckily we already had a custom hook In the interest of avoiding the beta release of Apollo, we chose to store the data in
It works great but I’m just curious what other people are using to get around this. I feel like we got lucky that we already had |
I'm using oldschool react classes, so keep the results in component state. Then I check and update the results in
Then showing loading state based on whether there are results:
It's not ideal but does the trick for now |
There was an intentional breaking change in Apollo Client 3.0.0.
When refetching or when using loadMore,
results
andtotalCount
revert temporarily toundefined
.For in-depth information and debate, see threads like
It could impact Vulcan in a number of ways, but so far I have only been looking at
multi2.js
. See Vulcan discussion at https://vulcanjs.slack.com/archives/C2LJQHTLP/p1601657376018800A possible solution is to update to
@apollo/[email protected]
and overrideuseQuery
. Or changeVulcan/packages/vulcan-core/lib/modules/containers/multi2.js
Lines 110 to 113 in 78d0e99
The text was updated successfully, but these errors were encountered: