LakeQL
  • Overview
Server Setup
  • Create Server
  • Define Config
  • Yoga Configuration
  • createLakeQLApp
Authentication
  • Authorization Model
  • JWT Authentication
  • Permissions
  • Scope Authorization
  • Trino User Impersonation
  • Debugging Identity
Schema Builder
  • Builder Configuration
  • Scalar Types
  • Comparison Types
  • Pagination
  • Input Validation
Customization
  • Custom Queries & Mutations
  • Extending Core
  • CORS Configuration
  • Error Handling
  • API Reference
GitHub
LakeQL
  1. API
  2. Schema Builder
  3. Input Validation

On this page

  1. Built-In Validation
  2. Adding Validation

Input Validation

How argument values are validated before a query runs.

The builder enables Pothos's validation plugin. Input arguments are validated with Zod schemas before a resolver runs. A failing validation becomes a GraphQL error rather than reaching the data source.

Built-In Validation #

The perPage paging argument is validated out of the box. It must be at least 1 and no more than the configured maximum. A request asking for more rows than allowed is rejected with a clear message instead of silently capping.

Adding Validation #

When you define custom queries or mutations, attach a Zod schema to an argument through the field's validate option. This is the same way the built-in paging input works. Validation errors are collected and surfaced as a single GraphQL error through LakeQL's error handling.

Previous page

Pagination

Next page

Customization