Open samuba opened 1 year ago
When I do a query with a nested query inside a nested query the type for the second nested properties is unknown.
unknown
So this query:
const { data } = await supabase .from('events') .select(`name, guests: event_guests(attending, user: user_id(name))`)
Will result in the following type for the data variable. We see that guests.user.name is unknown but guests.attending is properly typed:
data
guests.user.name
guests.attending
{ name: string; } & { guests: ( { attending: string; } & { user: { name: unknown; } | { name: unknown; }[]; } ) | ( { attending: string; } & { user: { name: unknown; } | { name: unknown; }[]; } )[]; }[]
guests.user.name should have the proper type inferred. string in this example.
string
Bug report
Describe the bug
When I do a query with a nested query inside a nested query the type for the second nested properties is
unknown
.To Reproduce
So this query:
Will result in the following type for the
data
variable. We see thatguests.user.name
isunknown
butguests.attending
is properly typed:Expected behavior
guests.user.name
should have the proper type inferred.string
in this example.System information