File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change @@ -395,3 +395,43 @@ const postgrest = new PostgrestClient<Database>(REST_URL)
395
395
>
396
396
> ( true )
397
397
}
398
+
399
+ // Test overrideTypes deep nesting with embedded inner relation
400
+ {
401
+ const result = await postgrest
402
+ . from ( 'users' )
403
+ . select ( '*, messages(*, channels!inner(*))' )
404
+ . overrideTypes <
405
+ {
406
+ messages : { channels : { data : string } } [ ]
407
+ } [ ]
408
+ > ( )
409
+ if ( result . error ) {
410
+ throw new Error ( result . error . message )
411
+ }
412
+ let data : typeof result . data
413
+ expectType <
414
+ TypeEqual <
415
+ typeof data ,
416
+ {
417
+ age_range : unknown
418
+ catchphrase : unknown
419
+ data : CustomUserDataType | null
420
+ status : 'ONLINE' | 'OFFLINE' | null
421
+ username : string
422
+ messages : {
423
+ id : number
424
+ username : string
425
+ channels : {
426
+ id : number
427
+ data : string
428
+ slug : string | null
429
+ }
430
+ data : Json
431
+ channel_id : number
432
+ message : string | null
433
+ } [ ]
434
+ } [ ]
435
+ >
436
+ > ( true )
437
+ }
You can’t perform that action at this time.
0 commit comments