Skip to main content
The optional Pydantic integration derives a GraphQL object or input type from a Pydantic v2 model — mapping its fields, optionality, and defaults — and runs the model’s validators on input coercion. It lives behind the [pydantic] extra and is never imported by the core.
When a Pydantic-backed input is supplied, the coerced values are constructed through the model so its validators run; a validation failure surfaces as a GraphQL error in the response rather than crashing execution. Both helpers also work as decorators.