Writing queries, mutations, actions, and HTTP actions with proper argument validation, error handling, internal functions, and runtime considerations
The 'convex-functions' skill provides developers with a comprehensive framework for writing and managing Convex functions, including queries, mutations, actions, and HTTP actions. It focuses on ensuring robust argument validation, proper error handling, and adherence to runtime best practices. By offering structured templates and examples, this skill helps users reduce common mistakes when interacting with the Convex database or integrating external APIs, while maintaining code quality and consistency across projects.
Key features of this skill include support for reactive, cached, and read-only queries, transactional mutations for database modifications, and actions that facilitate external API calls without direct database access. HTTP actions allow for integration with webhooks and API endpoints, broadening the skill's applicability. All function types enforce argument validation and comply with @convex-dev/eslint-plugin rules, promoting reliable, maintainable code. The skill also emphasizes explicit table references in database operations and encourages consulting the latest documentation before implementation, ensuring up-to-date and secure usage.
This skill is particularly useful for developers building applications that rely on real-time data fetching, database management, and API integrations within the Convex ecosystem. It benefits backend engineers, full-stack developers, and technical teams who need to implement robust, maintainable server-side functions while adhering to best practices for error handling and runtime performance. Typical use cases include fetching user data, creating or deleting tasks, integrating with external services, and exposing HTTP endpoints for web applications and microservices.
You can create queries, mutations, actions, and HTTP actions. Queries are read-only and reactive, mutations modify the database, actions can call external APIs, and HTTP actions can be used for webhooks or API endpoints.
Yes, all examples in this skill use argument validators and proper error handling to ensure robust and predictable function behavior.
No, actions cannot access the database directly; they operate through runQuery or runMutation if needed and are primarily used for external API integrations.
Only queries are cached and reactive. Mutations, actions, and HTTP actions do not have built-in caching.
You should consult the primary Convex documentation, including sections on query functions, mutation functions, actions, and HTTP actions, to ensure proper usage and up-to-date practices.
Quick Setup:
.claude/skills/Repository
waynesutton/convexskills