@@ -197,13 +197,13 @@ export type ProcessNode<
197
197
RelationName extends string ,
198
198
Relationships extends GenericRelationship [ ] ,
199
199
NodeType extends Ast . Node
200
- > = NodeType [ 'type' ] extends Ast . StarNode [ 'type' ] // If the selection is *
200
+ > = NodeType extends Ast . StarNode // If the selection is *
201
201
? Row
202
- : NodeType [ 'type' ] extends Ast . SpreadNode [ 'type' ] // If the selection is a ...spread
203
- ? ProcessSpreadNode < Schema , Row , RelationName , Relationships , Extract < NodeType , Ast . SpreadNode > >
204
- : NodeType [ 'type' ] extends Ast . FieldNode [ 'type' ]
205
- ? ProcessFieldNode < Schema , Row , RelationName , Relationships , Extract < NodeType , Ast . FieldNode > >
206
- : SelectQueryError < 'Unsupported node type.' >
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 } >
207
207
208
208
/**
209
209
* Processes a FieldNode and returns the resulting TypeScript type.
@@ -369,7 +369,10 @@ type ProcessSpreadNode<
369
369
/**
370
370
* Helper type to process the result of a spread node.
371
371
*/
372
- type ProcessSpreadNodeResult < Result > = Result extends Record < string , SelectQueryError < string > >
372
+ type ProcessSpreadNodeResult < Result > = Result extends Record <
373
+ string ,
374
+ SelectQueryError < string > | null
375
+ >
373
376
? Result
374
377
: ExtractFirstProperty < Result > extends infer SpreadedObject
375
378
? ContainsNull < SpreadedObject > extends true
0 commit comments