Open
Description
Description
Would be nice to have for passing query options around. I'm using tanstack vue query client (and it's awesome), made a generic component that takes a query option as prop, but I had to copy-paste QueryKey type from the client to make the compiler happy:
interface DatasetQueryData {
headers?: {
Authorization: string
}
path: {
slug: string
}
}
type QueryKey<TOptions extends Options> = [
Pick<TOptions, 'baseUrl' | 'body' | 'headers' | 'path' | 'query'> & {
_id: string
_infinite?: boolean
}
]
const { slug, query } = defineProps<{
slug: string
query: (options: OptionsLegacyParser<DatasetQueryData>) => UndefinedInitialQueryOptions<
DatasetType,
ErrorModel,
DatasetType,
QueryKey<DatasetQueryData>
> & {
queryKey: QueryKey<DatasetQueryData>
}
}>()
Activity