envelop icon indicating copy to clipboard operation
envelop copied to clipboard

explore using envelop for validation

Open n1ru4l opened this issue 4 years ago • 1 comments

What if we could annotate input fields/args in SDL (or extension fields) with validation rules e.g. string length 50 and enforce the validation in the extended validation phase 🤔

People also use custom scalars for this 🤔

I personally prefer doing it within resolvers and avoid adding any scalars.

Talked with someone on Crisp who wishes to have something like that.

I think we could support all of those flows and let people choose what they want, but still give our opinion and recommendations on how we personally would do stuff.

n1ru4l avatar Jul 23 '21 16:07 n1ru4l

I think for simple validations it could be nice. Was thinking also about doing that as scalar arguments (so it doesn't run as part of the field resolver). Not sure if it's possible

dotansimha avatar Jul 24 '21 08:07 dotansimha