Skip to content

Commit f22849b

Browse files
committed
chore: add TODO
1 parent 16380f9 commit f22849b

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

src/select-query-parser/result.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -198,13 +198,15 @@ export type ProcessNode<
198198
RelationName extends string,
199199
Relationships extends GenericRelationship[],
200200
NodeType extends Ast.Node
201-
> = NodeType['type'] extends Ast.StarNode['type'] // If the selection is *
202-
? Row
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.'>
201+
> =
202+
// TODO: figure out why comparing the `type` property is necessary vs. `NodeType extends Ast.StarNode`
203+
NodeType['type'] extends Ast.StarNode['type'] // If the selection is *
204+
? Row
205+
: NodeType['type'] extends Ast.SpreadNode['type'] // If the selection is a ...spread
206+
? ProcessSpreadNode<Schema, Row, RelationName, Relationships, Extract<NodeType, Ast.SpreadNode>>
207+
: NodeType['type'] extends Ast.FieldNode['type']
208+
? ProcessFieldNode<Schema, Row, RelationName, Relationships, Extract<NodeType, Ast.FieldNode>>
209+
: SelectQueryError<'Unsupported node type.'>
208210

209211
/**
210212
* Processes a FieldNode and returns the resulting TypeScript type.

0 commit comments

Comments
 (0)