convex-functions

Implement Convex queries, mutations, actions, and HTTP actions with validation.

Updated Aug 30, 2025
One-click install
npx skills add https://github.com/kristofferaas/deep-stortinget --skill convex-functions-kristofferaas
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: convex-functions
Source: https://github.com/kristofferaas/deep-stortinget/tree/main/.agents/skills/convex-functions
Command: npx skills add https://github.com/kristofferaas/deep-stortinget --skill convex-functions-kristofferaas

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a comprehensive guide to writing and understanding Convex functions, enabling developers to build robust applications with proper validation, error handling, and efficient data management.

Core Features & Use Cases

  • Function Types: Learn to implement Queries (read-only, cached), Mutations (write operations), Actions (external API calls), and HTTP Actions (webhooks/APIs).
  • Best Practices: Adheres to strict code quality standards, including argument validation, explicit table names, and error handling.
  • Use Case: Develop a real-time chat application where users can send messages (Mutation), fetch message history (Query), and receive notifications via external services (Action).

Quick Start

Use the convex-functions skill to create a new user record in your Convex database.

Frequently Asked Questions about convex-functions

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write Convex functions for queries, mutations, and actions?

Convex functions define backend logic using queries for reactive reads, mutations for transactional writes, and actions for external API integrations. Argument validation and error handling ensure secure, efficient data operations across these function types.

What is the difference between internal functions and HTTP actions in Convex?

Internal functions handle standard database operations via queries and mutations, while HTTP actions process incoming webhooks and external API requests. HTTP actions expose endpoints for external integrations, distinct from internal reactive query flows.

How do I validate arguments and handle errors in Convex mutations?

Convex mutations require strict argument validation and explicit error handling to execute transactional write operations securely. Validating inputs before writing data prevents runtime errors and maintains robust application state.

Can I use Convex actions to call external APIs and send notifications?

Convex actions specifically handle external API calls, enabling integrations like sending real-time notifications via external services. They operate alongside queries and mutations to manage asynchronous, non-transactional operations.

How do I handle webhooks using Convex HTTP actions?

Convex HTTP actions process incoming webhook requests by exposing API endpoints. They handle external HTTP payloads, validating incoming data before triggering internal mutations or actions for downstream processing.

Do I need runtime considerations for reactive queries in Convex?

Reactive queries in Convex require runtime considerations to maintain efficient, cached, read-only data fetching. Properly structuring these queries ensures real-time UI updates without hitting performance bottlenecks.