fix: add NonNegativeInt scalar and validate GraphQL pagination args

Closed
ID
4mo ago
+622-404

Fixing #7474 with new scalar class called NonNegativeInt()

Summary by CodeRabbit

  • Improvements

    • Pagination arguments (limit, offset and related paging params) now enforce non-negative integers across GraphQL endpoints, improving validation and error clarity.
  • New Features

    • Introduced a NonNegativeInt scalar to standardize non-negative integer validation for GraphQL inputs.
  • Tests

    • Added unit tests verifying negative or invalid pagination inputs are rejected with "non-negative integer" validation errors.
by CodeRabbit
  • New Features
    • Added a non-negative integer input type for GraphQL, enabling explicit non-negative validation for numeric arguments.
  • Bug Fixes
    • Pagination parameters (limit, offset and related paging args) now enforce non-negative values and return clearer errors for invalid inputs.
  • Tests
    • Added unit tests to verify negative limit/offset values are rejected with appropriate error messages.

Tested

  • pytest backend/tests/unit/graphql/test_query.py and passing:
image