Apollo-client: refetchQueries doesn't update loading

Created on 5 Jun 2019  路  4Comments  路  Source: apollographql/apollo-client

Intended outcome:

If refetchQueries causes a <Query> be refetched, the loading render-prop argument should be true while it is refetching.

Actual outcome:

The loading render-prop argument remains false, but eventually the correct data does load.

This seemingly makes it impossible to change the UI state while the data is stale. For example I want to grey out an "Add" button after a mutation while the query is still reloading so people can't double click and cause duplicates.

Versions

鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]

Most helpful comment

Also, there's awaitRefetchQueries option, which doen't resolve mutation promise, until all refetching queries are resolved.

All 4 comments

Did you try adding notifyOnNetworkStatusChange: true?

Also, there's awaitRefetchQueries option, which doen't resolve mutation promise, until all refetching queries are resolved.

I did try notifyOnNetworkStatusChange but it didn't help unfortunately.

Also, there's awaitRefetchQueries option, which doen't resolve mutation promise, until all refetching queries are resolved.

Perfect, thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

stubailo picture stubailo  路  3Comments

jamesreggio picture jamesreggio  路  3Comments

elie222 picture elie222  路  3Comments

canercandan picture canercandan  路  3Comments

joergbaier picture joergbaier  路  3Comments