Sorry, we don't support your browser.  Install a modern browser

Field Validations#24

Allow users to enforce the format of input for fields, e.g. using RegEx.

a year ago

A list of fields validation should be made here, this is wide because each field type has it’s own rules. For instance, I’d like to get field validation for JSON fields, but that’s very different from a Number or Text field.

Maybe considering regrouping fields together when they’re similar and go in-depth per field category?
Main post could also list all field types and their validations.

Not sure what’s the best approach here.

a year ago

It makes sense that some field types would have a different validation API. You could allow some basic length/range tests on strings and numbers, regex, custom formulas, schema validation for JSON/XML, etc. Personally, I’d be happy with just regex to start, but an actual UX would be good for data modelers with less programming experience.

It would also be good UX to have some presets for common things, like URL-style slugs. Pretty much every public-facing model I have uses slugs (valid, readable URLs are important), and my users break them all the time. Never trust human input :-(

Also, to be clear, validation really needs to happen at the API level as well as the editor UX. If I call a mutation, I’d like to to get back usable, readable error messages from the GQL endpoint. Ideally I could customize that error message, with extra hints to help people figure them out.

a year ago
1

Also, validations/constraints on relations and media would be rad. I’d like to say things like “must be a JPEG, at least 500px on a side”, or “relation to member of type X, when supplied where clause evaluates to true”)

a year ago
Merged JSON Schema validation#32
a year ago
Merged URL Field#57
a year ago
Merged Field Cardinality#38
8 months ago

#66 (repeater fields) can probably be rolled into this as well, once #43 is addressed, since repeating rules would just be another form of validation.

8 months ago
Changed the status to
Planned
7 months ago
Changed the status to
In Development
5 days ago