-
-
Couldn't load subscription status.
- Fork 126
Closed
Labels
Milestone
Description
Tanstack-query supports transforming query results using the "select" operator:
https://tanstack.com/query/latest/docs/react/guides/migrating-to-react-query-3#query-data-selectors
However, using "select" with ZenStack-generated hooks causes typing errors.
useFindFirstUser({}, { select: (data) => data.name});Type '(data: GetResult<{ id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: Date | null; password: string | null; name: string | null; image: string | null; }, unknown> & {} & { ...; }) => string | null' is not assignable to type '(data: GetResult<{ id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: Date | null; password: string | null; name: string | null; image: string | null; }, unknown> & {} & { ...; }) => GetResult<...> & ... 1 more ... & { ...; }'.
Type 'string | null' is not assignable to type 'GetResult<{ id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: Date | null; password: string | null; name: string | null; image: string | null; }, unknown> & {} & { ...; }'.
Type 'null' is not assignable to type 'GetResult<{ id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: Date | null; password: string | null; name: string | null; image: string | null; }, unknown> & {} & { ...; }'.
Type 'null' is not assignable to type 'GetResult<{ id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: Date | null; password: string | null; name: string | null; image: string | null; }, unknown>'.