Commit 60a5dcc
committed
fix (postgrest-js): preserve nullability when using JSON path (->) (#1635)
The JSON path resolver (JsonPathToType) stripped `null` using Exclude<T, null>
but never added it back to the resulting type. This caused `.select('col->a')`
to infer a non-nullable type even when the underlying JSON column was nullable.
Example:
json_col: { a: string } | null
.select('json_col->a') // inferred `string` instead of `string | null`
This patch re-attaches `| null` when the root JSON column contains null,
ensuring correct type inference for nullable JSON columns and nullable
nested paths.
Fixes: #16351 parent 13af49b commit 60a5dcc
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
618 | 618 | | |
619 | 619 | | |
620 | 620 | | |
621 | | - | |
| 621 | + | |
622 | 622 | | |
623 | 623 | | |
624 | 624 | | |
| |||
0 commit comments