Home / Companies / Convex / Blog / Post Details
Content Deep Dive

When to and when not to use return validators

Blog post from Convex

Post Details
Company
Date Published
Author
Mike Cann
Word Count
1,565
Company Posts That Month
5
Language
English
Hacker News Points
-
Post removed?
No
Summary

Mike Cann discusses the evolving guidance on using return validators in Convex queries and mutations, highlighting the shift from always recommending their use to a more nuanced approach. Initially, return validators were advised to mitigate TypeScript circular type issues and enforce runtime correctness, but the "always" rule led to problems such as verbosity, increased token usage, and potential schema errors due to the limitations of Large Language Models (LLMs). The article explains that while return validators are beneficial for enforcing exact runtime contracts, especially in scenarios like static codegen and OpenAPI generation, their blanket use can lead to inefficiencies and complications in refactoring. Therefore, the new guideline encourages relying on TypeScript types and inference by default, reserving return validators for specific cases where runtime exactness is essential. Convex offers a comprehensive backend platform for building full-stack AI projects, integrating functionalities like cloud functions, databases, and real-time updates.

Trends Found in this Post
Trend Post Mentions Total Month Mentions Posts Companies MoM
LLM 3 5,138 781 181 +34%
Real-time 1 5,046 1,089 214 +11%
Vector Search 1 2,212 422 133 +33%
Use This Data

Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.