Skip to content
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

useQuery loading state starts with false after updating to 3.5.x #9145

Closed
cyanic-webdesign opened this issue Dec 1, 2021 · 7 comments
Closed
Assignees

Comments

@cyanic-webdesign
Copy link

I have the following useQuery in my code:

const { loading, data } = useQuery(productOverviewQuery, {
  ssr: true,
  variables: composeVariables({ ...props  }),
});

console.log('loading', loading);

Up until version 3.4.8 the outcome of the loading property was:

loading: true
loading: false

but after updating to 3.5.x the loading state starts with false like:

loading: false
loading: true
loading: false

After the update, the first false loading state breaks my clientside flow as I act upon that state. Does anybody encounter this issue as well, and how can this be fixed?

@brainkim brainkim self-assigned this Dec 1, 2021
@junajan
Copy link

junajan commented Dec 10, 2021

Hi @cyanic-webdesign - we encountered this behaviour as well. When running a second useQuery with same query but different variables, it always returns loading: false together with data object and then it actually queries the new resource.

This behaviour breaks our app because we expect that the resource will have some extra fields which in the old object were set to null.

@eturino
Copy link

eturino commented Jan 20, 2022

@junajan that's exactly what's happening to us, and giving us loads of problems since the upgrade. We probably will revert to 3.4.x until this is addressed.

@fabien-somnier
Copy link

any update on this issue? it's already a 4 month old one, and no news since more than 2 months :(

@dylanwulf
Copy link
Contributor

Possibly related to #9549, #9580

@dylanwulf
Copy link
Contributor

Hey guys, please give the new release candidate a try (@apollo/client@3.6.0-rc.0) and see if the issue is fixed there

@AlexMost
Copy link

AlexMost commented Apr 28, 2022

Also have met this issue in 3.5.10, seems like 3.6.0 fixed it. Thank you

@cyanic-webdesign
Copy link
Author

Thanks for the fix, seems to be working now!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants