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
We're currently not invoking DataObject::validate() in mutations. That would be a start, but this problem is actually a bit more complex than that. Usually, what is required for low-level data integrity isn't necessarily what is required for business cases. Validation in the API should resemble something closer to Form::validate() than DataObject::validate().
I'm pretty sure this is as simple as creating a Validator interface, and allowing registration of them against the operation:
Like resolvers, this probably isn't an either/or. You can just prefer explicitly defined validators over discovered ones, and then use a default validator when neither comes through.
The text was updated successfully, but these errors were encountered:
We're currently not invoking
DataObject::validate()
in mutations. That would be a start, but this problem is actually a bit more complex than that. Usually, what is required for low-level data integrity isn't necessarily what is required for business cases. Validation in the API should resemble something closer toForm::validate()
thanDataObject::validate()
.I'm pretty sure this is as simple as creating a
Validator
interface, and allowing registration of them against the operation:You'd also want a default validator to be registered against the schema config to manage basic validation for all dataobjects.
Or we could even do it like resolvers, where you just have a monolithic class and methods are discovered.
And of course, the schema config then becomes:
If not,
Validator
should extendIdentifiable
so we can use the registry (as used in Bulk Loaders) and refer to them with better semantics.Like resolvers, this probably isn't an either/or. You can just prefer explicitly defined validators over discovered ones, and then use a default validator when neither comes through.
The text was updated successfully, but these errors were encountered: