File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -228,7 +228,9 @@ type ConstructFieldDefinition<
228
228
? R
229
229
: unknown
230
230
> extends true
231
- ? Child | null
231
+ ? Field extends { inner : true }
232
+ ? Child
233
+ : Child | null
232
234
: Relationships extends unknown [ ]
233
235
? HasFKey < Field [ 'hint' ] , Relationships > extends true
234
236
? Field extends { inner : true }
@@ -259,7 +261,9 @@ type ConstructFieldDefinition<
259
261
? R
260
262
: unknown
261
263
> extends true
262
- ? Child | null
264
+ ? Field extends { inner : true }
265
+ ? Child
266
+ : Child | null
263
267
: Relationships extends unknown [ ]
264
268
? HasFKeyToFRel < Field [ 'original' ] , Relationships > extends true
265
269
? Field extends { inner : true }
Original file line number Diff line number Diff line change @@ -154,12 +154,18 @@ const postgrest = new PostgrestClient<Database>(REST_URL)
154
154
{
155
155
const { data : message , error } = await postgrest
156
156
. from ( 'messages' )
157
- . select ( 'user:users !inner(*)' )
157
+ . select ( 'channels !inner(*, channel_details!inner(*) )' )
158
158
. single ( )
159
159
if ( error ) {
160
160
throw new Error ( error . message )
161
161
}
162
- expectType < Database [ 'public' ] [ 'Tables' ] [ 'users' ] [ 'Row' ] > ( message . user )
162
+ type ExpectedType = Prettify <
163
+ Database [ 'public' ] [ 'Tables' ] [ 'channels' ] [ 'Row' ] & {
164
+ channel_details : Database [ 'public' ] [ 'Tables' ] [ 'channel_details' ] [ 'Row' ]
165
+ }
166
+ >
167
+
168
+ expectType < ExpectedType > ( message . channels )
163
169
}
164
170
165
171
// one-to-many relationship
You can’t perform that action at this time.
0 commit comments