-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
the query builder doesn't handle null values for json fields #290
Comments
When I omit the value from the object
|
FFR, I recommend logging the generated EdgeQL to try to debug stuff like this. Just take your query builder expression and call the Seems like you've provided the wrong query? There is no JSON field in this query. Your Here's that same query rewritten to use a parameter of type const query = e.params({raw_data: e.json}, params =>
e.for(e.json_array_unpack(params.raw_data), item => {
return e.insert(e.Movie, {
title: e.cast(e.str, item.title),
github_scopes: e.cast(e.array(e.str), item.github_scopes),
});
})
);
const result = await query.run(client, {
raw_data: JSON.stringify([{title: "The Marvels", github_scopes: [] }]),
}); Since you're casting
|
Query looks like this
I'm getting the following error (could use a better message too #275 )
And it happens because of this line
github_scopes: e.cast(e.array(e.str), item.github_scopes)
in a json unpack insert callback where the value ofgithub_scopes
isnull
The text was updated successfully, but these errors were encountered: