Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add validate directive and transformer package #3103

Closed

Conversation

bobbyu99
Copy link
Contributor

@bobbyu99 bobbyu99 commented Jan 3, 2025

Description of changes

This PR added a new @validate directive and a graphql-validate-transformer package.

Detail of changes:

  • set up a new graphql-validate-transformer package with some package configurations
    • added ValidateTransformer class that does nothing for now
    • added 1 skeleton test file
  • updated a bunch of package.json with the new graphql-validate-transformer package
  • updated snapshot test and transformer test to acknowledge the new transformer
  • added ValidateTransformer to transformer chain
  • added @validate directive definitions (API approved)

Description of how you validated changes

Checklist

  • PR description included
  • yarn test passes
  • E2E test run linked
  • Tests are changed or added
  • Relevant documentation is changed or added (and PR referenced)
  • New AWS SDK calls or CloudFormation actions have been added to relevant test and service IAM policies
  • Any CDK or CloudFormation parameter changes are called out explicitly

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@bobbyu99 bobbyu99 changed the base branch from main to feature/server-side-validation January 3, 2025 21:14
@bobbyu99
Copy link
Contributor Author

bobbyu99 commented Jan 6, 2025

Pending API review for:

directive @validate(
  type: ValidationType!,
  value: String!,
  errorMessage: String
) on FIELD_DEFINITION

enum ValidationType {
  gt
  lt
  gte
  lte
  minLength
  maxLength
  startsWith
  endsWith
  matches
}

Update:
API approved.

@bobbyu99 bobbyu99 force-pushed the validate-transformer-package branch from bed27b0 to b9f9798 Compare January 17, 2025 18:30
@bobbyu99 bobbyu99 closed this Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant