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

[openapi-react-query] Misleading useQuery functionKey documentation #2034

Open
ShockiTV opened this issue Dec 3, 2024 · 0 comments
Open
Assignees
Labels
bug Something isn't working openapi-ts Relevant to the openapi-typescript library

Comments

@ShockiTV
Copy link

ShockiTV commented Dec 3, 2024

On official documentation https://openapi-ts.dev/openapi-react-query/use-query

The functionKey generated is described as The functionKey is [method, path, params].

But the real 3rd argument is object with params property (so closer to options than params)

To correctly invalidate/update cache, you need to wrap it inside the object
queryClient.setQueryData(["get", GET_PROJECT_PATH, { params: { path: { id: Number(data.id) } } }], data)

@ShockiTV ShockiTV added bug Something isn't working openapi-ts Relevant to the openapi-typescript library labels Dec 3, 2024
@drwpow drwpow self-assigned this Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working openapi-ts Relevant to the openapi-typescript library
Projects
None yet
Development

No branches or pull requests

2 participants