Open
Description
Description
I'm using solid js, openapi-ts, and solid-query together. Obviously not the most common stack in the world, but I'm running into a small problem. The api takes both a path parameter (id) and a body with two fields. All are required. When I create the API and provide the path parameter up front while inserting the body parameters later, typescript fails.
const clearData = createMutation(() => ({
...clearDataMutation({
path: {
id: params.id,
},
}),
onSuccess: (data) => {
queryClient.setQueryData(queryKey, updater);
},
}));
clearData.mutate({ // is not assignable to parameter of type 'Options<ClearDataData>'. Property 'path' is missing in type ...
body: {
field1: 1,
field2: 2,
},
});
The provided fields need to be excluded or made optional from the signature of the mutate
method.
Reproducible example or configuration
https://stackblitz.com/edit/hey-api-client-fetch-example
OpenAPI specification (optional)
No response
System information (optional)
No response