-
Notifications
You must be signed in to change notification settings - Fork 79
Open
Description
When attempting to cast a subselect into JSON, this expression generates incorrect EdgeQL
const q = e.select(e.Movie, (movie) => ({
node: movie,
cursor: e.to_str(
e.cast(
e.json,
e.select(movie, () => ({
id: true,
release_year: true,
})),
),
),
})); WITH
__scope_0_defaultMovie := DETACHED default::Movie
SELECT __scope_0_defaultMovie {
single node := __scope_0_defaultMovie,
single cursor := (
std::to_str((<std::json>(SELECT DETACHED default::Movie {
id,
release_year
})))
)
}Notice the DETACHED default::Movie in the sub-select. This should be __scope_0_defaultMovie.
This is a somewhat recent regression since the project rename, so that should narrow the offending issue down to something in our recent updates to the automatic with extraction logic.
Note, that it does work if you return a Free Object instead of the subselect:
const q = e.select(e.Movie, (movie) => ({
node: movie,
cursor: e.to_str(
e.cast(
e.json,
e.select({
id: movie.id,
release_year: movie.release_year,
}),
),
),
}));Metadata
Metadata
Assignees
Labels
No labels