-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
Right now the queryKeys & mutationKeys are generated from the "ActualOperationName" from nswag, and it looks like all the options to customize queries/mutations omit our ability to change the key
So, for example, something like this could be generated:
export function getAllUsersQueryKey(...params: any[]): QueryKey {
return trimArrayEnd([
'Client',
'getAllUsers',
]);
}
While this might also get generated:
export function createUserMutationKey(): MutationKey {
return trimArrayEnd([
'Client',
'createUser',
]);
}
We currently have no way, as far as I can tell, to control react-query's caching, and tell it that "createUser" changes the result of "getAllUsers". Attempting to change nswag's strategy e.g. /operationGenerationMode:MultipleClientsFromOperationId does not seem to make any difference (likely because of the usage of ActualOperationName.
Why not let devs pass in their own queryKeys, either in addition or instead of the generated ones?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels