supabase-cache-helpers
supabase-cache-helpers copied to clipboard
Tanstack skipToken is not supported in queries
Describe the bug
Tanstack query exports a skipToken symbol which can be used to prevent a query running while waiting for a value to be defined (e.g. from a dependent query) - similar to using enabled
but more type safe. This does not work with supabase-cache-helpers and gives a typescript error.
To Reproduce
import { useQuery } from '@supabase-cache-helpers/postgrest-react-query';
import { skipToken } from '@tanstack/react-query';
const supabase = supabaseBrowserClient();
const accountId: string | undefined = getAccountId()
const { data } = useQuery(
accountId ? myDependentQuery(supabase, accountId) : skipToken,
);
// No overload matches this call...
Expected behavior Using skipToken in a query should be possible.
Additional context Add any other context about the problem here.