Add generic query/mutation types

This commit is contained in:
jeffvli 2023-04-27 20:32:56 -07:00
parent 8f042ad448
commit 17cf624f6a
3 changed files with 123 additions and 175 deletions

View file

@ -36,6 +36,16 @@ export const queryClient = new QueryClient({
queryCache,
});
export type QueryHookArgs<T> = {
options?: QueryOptions;
query: T;
serverId?: string;
};
export type MutationHookArgs = {
options?: MutationOptions;
};
export type QueryOptions = {
cacheTime?: UseQueryOptions['cacheTime'];
enabled?: UseQueryOptions['enabled'];