Open CodesInChaos opened 2 weeks ago
I think I'll leave the custom scalar types until the edgedb-protocol
library is upgraded to protocol version 2.0. This provides names for the scalar types which can be added to the shared types.
Regarding constraints, I was thinking there might be a way to provide the https://github.com/Keats/validator as an option. But I can't think of a good API for this.
It's not a high priority for my current project, but if you can think of a compelling way to integrate this, I'm happy to accept contributions.
I'm interested in proper support for custom scalar types. This has some overlap with the
enum
support mentioned in the readme, in particular this applies to them as well:There is one additional challenge however: Custom scalars usually have constraints, so the new function needs to contain validation and return a custom
Result
type. Auto generating that isn't trivial for standard constraints, and practically impossible forexpression
constraints. So there needs to be a design that allows mixing auto-generated code with custom written code.