@@ -135,6 +135,7 @@ export type ProcessRPCNode<
135
135
: NodeType [ 'type' ] extends Ast . FieldNode [ 'type' ]
136
136
? ProcessSimpleField < Row , RelationName , Extract < NodeType , Ast . FieldNode > >
137
137
: SelectQueryError < 'RPC Unsupported node type.' >
138
+
138
139
/**
139
140
* Process select call that can be chained after an rpc call
140
141
*/
@@ -197,13 +198,13 @@ export type ProcessNode<
197
198
RelationName extends string ,
198
199
Relationships extends GenericRelationship [ ] ,
199
200
NodeType extends Ast . Node
200
- > = NodeType extends Ast . StarNode // If the selection is *
201
+ > = NodeType [ 'type' ] extends Ast . StarNode [ 'type' ] // If the selection is *
201
202
? Row
202
- : NodeType extends Ast . SpreadNode // If the selection is a ...spread
203
- ? ProcessSpreadNode < Schema , Row , RelationName , Relationships , NodeType >
204
- : NodeType extends Ast . FieldNode
205
- ? ProcessFieldNode < Schema , Row , RelationName , Relationships , NodeType >
206
- : SelectQueryError < 'Unsupported node type.' & { nodeType : NodeType } >
203
+ : NodeType [ 'type' ] extends Ast . SpreadNode [ 'type' ] // If the selection is a ...spread
204
+ ? ProcessSpreadNode < Schema , Row , RelationName , Relationships , Extract < NodeType , Ast . SpreadNode > >
205
+ : NodeType [ 'type' ] extends Ast . FieldNode [ 'type' ]
206
+ ? ProcessFieldNode < Schema , Row , RelationName , Relationships , Extract < NodeType , Ast . FieldNode > >
207
+ : SelectQueryError < 'Unsupported node type.' >
207
208
208
209
/**
209
210
* Processes a FieldNode and returns the resulting TypeScript type.
0 commit comments