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

Query with multiple params (eg. ['todo', id]) can't be found #3

Open
CptFabulouso opened this issue May 10, 2024 · 2 comments · May be fixed by #8
Open

Query with multiple params (eg. ['todo', id]) can't be found #3

CptFabulouso opened this issue May 10, 2024 · 2 comments · May be fixed by #8

Comments

@CptFabulouso
Copy link

Any attempt to modify query with key with multiple params (such as queryKey: ['todo', 'id-12344']) fails with error "Query not found"

Not sure in which lib the fix should be, I see
https://github.com/LovesWorking/react-query-external-dash/blob/main/src/_components/devtools/QueryActions.tsx#L44
uses toString on the queryKey, while
https://github.com/LovesWorking/react-query-external-sync/blob/main/src/_util/handleCommands.ts#L23
tries to compare the first item of query key with the stringified queryKey, which does not work. There it should probably also call toString on the queryKey.

@LovesWorking
Copy link
Owner

Great point. When I get some time next week I'll tackle the open issues. Thanks for pointing out the lines that may be causing this.

@wurmr
Copy link

wurmr commented May 16, 2024

FWIW this also happens if the second param is an object like queryKey: ['todo', { id: 12344 }]

@itelo itelo linked a pull request Jun 19, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants