You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Type 'paths' does not satisfy the constraint 'Record<string, Record<HttpMethod, {}>>'.
Index signature for type 'string' is missing in type 'paths'.ts(2344)
Reproduction
I have a client stored inside a React Context because I need access to the auth.js session to provide access tokens in the fetch middleware. The entire application is already wrapped in the client provider. I’m trying to avoid manually calling useClientContext() everywhere — I want a simple, local useMutation hook.
Expected result
One should be able to use the paths type with UseMutationMethod.
openapi-react-query version
0.2.5
Description
I’m trying to create a custom helper function to call useMutation without manually retrieving the client from the context each time:
However, TypeScript throws the following error:
Reproduction
I have a client stored inside a React Context because I need access to the auth.js session to provide access tokens in the fetch middleware. The entire application is already wrapped in the client provider. I’m trying to avoid manually calling
useClientContext()
everywhere — I want a simple, localuseMutation
hook.Expected result
One should be able to use the
paths
type withUseMutationMethod
.Extra
The text was updated successfully, but these errors were encountered: