lukemorales / query-key-factory

A library for creating typesafe standardized query keys, useful for cache management in @tanstack/query
https://www.npmjs.com/package/@lukemorales/query-key-factory
MIT License
1.2k stars 32 forks source link

When using skipToken all the data results are unknown #100

Open lukasbash opened 2 hours ago

lukasbash commented 2 hours ago

When working with dependent queries I am often times using the skipToken export, provided by react query. When using a query configuration in the semantics of e.g.:

foo: (baz: number | undefined ) => {
 queryKey: ["bar", baz],
 queryFn: baz ? new Promise<number>() : skipToken
}

The resulting data is not number | undefined but rather always unknown.

linear[bot] commented 2 hours ago

OSS-19 When using skipToken all the data results are unknown