benmccallum / fairybread

Input validation for HotChocolate
MIT License
115 stars 13 forks source link

Expose validation rules via schema / field #39

Open benmccallum opened 3 years ago

benmccallum commented 3 years ago

Goals:

  1. Expose FluentValidation rules via schema
  2. Accessibility - support pulling validation copy from resource files globalization (i18n)

Stretch goals:

  1. Support/execute + expose DataAnnotation attributes
benmccallum commented 3 years ago
  1. Needs investigation as we need to see if / how FluentValidation rules turn into metadata in the MVC integration and how we could repurpose that out of the schema. @jmercha suggested we could use / take inspiration from the FV ASP.NET Core adapters here

  2. I think this is something that wouldn't be solved by FairyBread, but by an existing globalization technique for FV. Surely there's a solution out there that folks can plug in already. Needs research.

Stretch goal 1. As mentioned previously, keen to not support data annotations, I'd like to keep this library focused solely on FluentValidation, but if enough people ask I'm open to considering how we might do it. Maybe there's a benefit for people exposing annotated EF models directly as inputs, but I personally would never be doing that.