Skip to content

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

Open
@mattfsourcecode

Description

@mattfsourcecode

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions