You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
However end users probably don't want multiple enums for each generated query module as this would break sharing. To get around this, there should be a macro for generating the shared types used by all other.
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 for expression constraints. So there needs to be a design that allows mixing auto-generated code with custom written code.
The text was updated successfully, but these errors were encountered:
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.The text was updated successfully, but these errors were encountered: