#next 13

4 messages · Page 1 of 1 (latest)

copper hemlock
#

How can I create a generic type of queries? Say I want to pass a prop through to a component such as this:

dayBookQuery: (opts: DayBookOptionProps) => SWRResponse<SupabaseManyRowResult<T>, PostgrestError>;

I am getting a type error on the 'count' value that's returned from the query, any idea how I would type this properly so that count isn't giving me errors or if there is a better way to generic type a query?

broken marsh
#

UseQueryResult ?

copper hemlock
#

still getting this: Property  count  does not exist on type  UseQueryResult<T[]>

broken marsh
#

Yes. What do you expect count to be?