edgedb-js
edgedb-js copied to clipboard
"No function overload function" when user-defined scalar used as function parameter
Code The code causing the error.
e.greet(e.cast(e.Name, 'greg'));
Schema
module default {
scalar type Name extending str {}
function greet(name: Name) -> str using (
"Hello, " ++ name ++ "!"
);
}
Generated EdgeQL
Exception thrown
Error or desired behavior
No function overload found for 'e.default.greet()' with args: Element: default::Name (One)
Versions (please complete the following information):
- OS:
- EdgeDB version (e.g.
2.0): 4.5+28216a1" - EdgeDB CLI version (e.g.
2.0): 4.1.0+03ae624 -
edgedb-jsversion (e.g.0.20.10;): 1.4.1 -
@edgedb/generateversion (e.g.0.0.7;): 0.4.1 - TypeScript version: 5.3.3
- Node/Deno version: 20.9.0
The workaround is to accept a primative as the type param e.g. str and cast it to the desired type in the function