Replies: 1 comment 2 replies
-
you can use |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Is there a way to get the last executed query data? My use case is as follows:
I am displaying a list of items in a data table (ag-grid) component. The data is fetched using react-query, every the filter, sort of pagination conditions change. The grid manages the filter/sort/page models and executes the query.
I have some action that I can perform on every row/data in the table. When the action (mutation) is executed, I want to optimistically update that row. So I need to get the query result for the query that provided that data, but I don't have the query variables at that point (only the name). How can I use queryClient.getQueryData to get the current list of items shown in the data (basically the result of the last execution of the query). I don't have the complete query key (which includes the filter/sort/page conditions).
Or is there some other means to do what I described?
Thanks
Anand
Beta Was this translation helpful? Give feedback.
All reactions