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.
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.:The resulting data is not
number | undefined
but rather alwaysunknown
.