Skip to content

onQueryStarted -> updateQueryData: pass query parameter #2728

Answered by phryneas
bogdan0083 asked this question in Q&A
Discussion options

You must be logged in to vote

Please note that I'm using TypeScript and my api is partially generated by rtk-query-codegen-openapi library. I can't just pass any arbitary argument to my mutation except what declared in mutation arguments type.

That shifts the answer from a "yes" to a "no", I'm sorry. But you could use api.utils.selectInvalidatedBy to get all cache entries that contain your resource and update them accordingly.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@bogdan0083
Comment options

@phryneas
Comment options

@phryneas
Comment options

Answer selected by bogdan0083
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants