File tree 2 files changed +19
-9
lines changed
2 files changed +19
-9
lines changed Original file line number Diff line number Diff line change @@ -78,15 +78,9 @@ type ProcessFieldNodeWithoutSchema<Node extends Ast.FieldNode> = IsNonEmptyArray
78
78
Node [ 'children' ]
79
79
> extends true
80
80
? {
81
- [ K in Node [ 'name' ] ] : Node [ 'children' ] extends Ast . StarNode [ ]
82
- ? any [ ]
83
- : Node [ 'children' ] extends Ast . FieldNode [ ]
84
- ? {
85
- [ P in Node [ 'children' ] [ number ] as GetFieldNodeResultName < P > ] : P [ 'castType' ] extends PostgreSQLTypes
86
- ? TypeScriptTypes < P [ 'castType' ] >
87
- : any
88
- } [ ]
89
- : any [ ]
81
+ [ K in GetFieldNodeResultName < Node > ] : Node [ 'children' ] extends Ast . Node [ ]
82
+ ? ProcessNodesWithoutSchema < Node [ 'children' ] > [ ]
83
+ : ProcessSimpleFieldWithoutSchema < Node >
90
84
}
91
85
: ProcessSimpleFieldWithoutSchema < Node >
92
86
Original file line number Diff line number Diff line change @@ -35,6 +35,22 @@ const REST_URL = 'http://localhost:3000'
35
35
}
36
36
expectType < TypeEqual < typeof result , typeof expected > > ( true )
37
37
}
38
+ // embeding renaming
39
+ {
40
+ const postgrest = new PostgrestClient ( REST_URL )
41
+ const { data } = await postgrest
42
+ . from ( 'projects' )
43
+ . select ( 'status,service:services(service_api_keys(*))' )
44
+ . single ( )
45
+ let result : Exclude < typeof data , null >
46
+ let expected : {
47
+ status : any
48
+ service : {
49
+ service_api_keys : any [ ]
50
+ } [ ]
51
+ }
52
+ expectType < TypeEqual < typeof result , typeof expected > > ( true )
53
+ }
38
54
// spread operator with stars should return any
39
55
{
40
56
const postgrest = new PostgrestClient ( REST_URL )
You can’t perform that action at this time.
0 commit comments