Skip to content
This repository has been archived by the owner on May 26, 2023. It is now read-only.

How to use awaitRefetchQueries? #247

Open
babouinette opened this issue May 25, 2020 · 0 comments
Open

How to use awaitRefetchQueries? #247

babouinette opened this issue May 25, 2020 · 0 comments

Comments

@babouinette
Copy link

Hello,

I have a problem where my mutation returns some results, but the refetchQuery is not done yet.

I want to stop an animation (remove a css class) when the refetchQuery is finished (so when the data is refreshed), not when the result of the mutation is Data(_).

For this, the mutation should return Data(_) only after the refetchQueries are done.

It seems that Apollo provides a boolean called awaitRefetchQueries, to make sure refetched queries are completed before the mutation is considered done.

If I try in my mutation :

~refetchQueries=[|"getAll"|],
~awaitRefetchQueries=true,

the compiler says : This argument cannot be applied with label ~awaitRefetchQueries

Does anyone use this with graphql_ppx?

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

1 participant