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

Add request payload validation middleware for /graphql and other endpoints #42

Open
mattfsourcecode opened this issue Jan 16, 2025 · 0 comments

Comments

@mattfsourcecode
Copy link
Owner

Details:

  • Use a validation library (e.g., joi or zod) to validate incoming request payloads.
  • Prevent invalid data from reaching the business logic layer, reducing potential errors and improving API security.
  • Define validation schemas for key fields such as headers, query parameters, and request bodies.

Action Items:

  1. Create validation schemas for frequently used API endpoints (e.g., /graphql).
  2. Integrate the validation middleware before the route handlers.
  3. Write tests to verify that invalid payloads return appropriate error responses (e.g., 400 Bad Request).
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

No branches or pull requests

1 participant