Migrating v4 to v5 give me couple of errors on some of the queries
Hi there i'm trying to migrated to v5 using the
ts
and in version5
but Im getting an eslint error message on the
codemodcodemod in the docs. After running it, I get some queries where I have to manually migrate te query. But I'm having problems understanding the error and how to migrate them. For example// v4
async function getOverzichtEigenBezwaarschriften(urlProps: IUrlProps) {
const { data } =
await omvUpInzageProjectfasenApi.get<IBezwaarschriftenPageableResponse>(
getOverzichtEigenBezwaarschriftenUrlSuffix(urlProps),
);
return data;
}
export function useOverzichtEigenBezwaarschriften({
projectfaseUuid,
groepUuid,
page,
keepPreviousData = false,
}: IRequest) {
const options = { ...defaultOptions, ...page } as IPagingOptions;
return useQuery<IBezwaarschriftenPageableResponse>({
queryKey: [
'overzicht-eigen-bezwaarschriften',
{ projectfaseUuid, groepUuid, page: options.pageParam },
],
queryFn: () => {
return getOverzichtEigenBezwaarschriften({
projectfaseUuid,
groepUuid,
options,
});
},
keepPreviousData,
enabled: !!projectfaseUuid,
staleTime: 0,
});
}// v4
async function getOverzichtEigenBezwaarschriften(urlProps: IUrlProps) {
const { data } =
await omvUpInzageProjectfasenApi.get<IBezwaarschriftenPageableResponse>(
getOverzichtEigenBezwaarschriftenUrlSuffix(urlProps),
);
return data;
}
export function useOverzichtEigenBezwaarschriften({
projectfaseUuid,
groepUuid,
page,
keepPreviousData = false,
}: IRequest) {
const options = { ...defaultOptions, ...page } as IPagingOptions;
return useQuery<IBezwaarschriftenPageableResponse>({
queryKey: [
'overzicht-eigen-bezwaarschriften',
{ projectfaseUuid, groepUuid, page: options.pageParam },
],
queryFn: () => {
return getOverzichtEigenBezwaarschriften({
projectfaseUuid,
groepUuid,
options,
});
},
keepPreviousData,
enabled: !!projectfaseUuid,
staleTime: 0,
});
}and in version5
export function useOverzichtEigenBezwaarschriften({
projectfaseUuid,
groepUuid,
page,
keepPreviousData = false,
}: IRequest) {
const options = { ...defaultOptions, ...page } as IPagingOptions;
return useQuery<IBezwaarschriftenPageableResponse>({
queryKey: [
'overzicht-eigen-bezwaarschriften',
{ projectfaseUuid, groepUuid, page: options.pageParam },
],
queryFn: () => {
return getOverzichtEigenBezwaarschriften({
projectfaseUuid,
groepUuid,
options,
});
},
keepPreviousData,
enabled: !!projectfaseUuid,
staleTime: 0,
});
}export function useOverzichtEigenBezwaarschriften({
projectfaseUuid,
groepUuid,
page,
keepPreviousData = false,
}: IRequest) {
const options = { ...defaultOptions, ...page } as IPagingOptions;
return useQuery<IBezwaarschriftenPageableResponse>({
queryKey: [
'overzicht-eigen-bezwaarschriften',
{ projectfaseUuid, groepUuid, page: options.pageParam },
],
queryFn: () => {
return getOverzichtEigenBezwaarschriften({
projectfaseUuid,
groepUuid,
options,
});
},
keepPreviousData,
enabled: !!projectfaseUuid,
staleTime: 0,
});
}but Im getting an eslint error message on the
queryKeyqueryKey The following dependencies are missing in your queryKey: optionseslint@tanstack/query/exhaustive-depsThe following dependencies are missing in your queryKey: optionseslint@tanstack/query/exhaustive-deps