aws-amplify / amplify-category-api

The AWS Amplify CLI is a toolchain for simplifying serverless web and mobile development. This plugin provides functionality for the API category, allowing for the creation and management of GraphQL and REST based backends for your amplify project.
https://docs.amplify.aws/
Apache License 2.0
89 stars 79 forks source link

Need validation on fields of the schema #2637

Open jewells07 opened 4 months ago

jewells07 commented 4 months ago

Describe the feature you'd like to request

We need the feature of validation on the fields. It may be with regex or any other better way.

Describe the solution you'd like

If we have a schema that has a field for price, the price would be a minimum of $5. It will be helpful in this kind of scenario. or username character, there will be many that this feature can very well handle for this kind of scenario. Better if this feature comes in field level & schema level both way.

Describe alternatives you've considered

Currently, we can handling the extra APIs in backend to pass the validations

Additional context

No response

Is this something that you'd be interested in working on?

Would this feature include a breaking change?

naedx commented 3 months ago

This is a common use case I have across applications.

craig-at-metashield-io commented 2 months ago

not sure if this helps, but i wrote this some time back and we use it a lot.

https://github.com/craig-at-metashield-io/graphql-validation-transformers

it does some basic number / string validation, such as min-max, length, regex, etc.

i was investigating if this is available yet on gen2, but it looks like not.