This skill should be used when implementing Convex query functions. It provides comprehensive guidelines for defining, registering, calling, and optimizing queries, including pagination, full text search, and indexing patterns.
This skill provides specialized guidance for implementing Convex query functions, including best practices for function definition, registration, calling patterns, pagination, indexing, and full text search.
Use this skill when:
This skill includes comprehensive reference documentation in references/query-guidelines.md that covers:
query and internalQuery)ctx.runQuery)api and internal objects)filter, using indexes with withIndex).order('asc') and .order('desc').unique() for single document retrievalfor await syntaxpaginationOptsValidator
paginationOpts (numItems and cursor)ctx.db.query().withIndex().collect() and .take(n)references/query-guidelines.md to understand the complete query patternsfilter methodfilter in queries; use withIndex insteadctx.runQuery to call queries from mutations or actionsnull implicitly if your query doesn't have an explicit return valueimport { query } from "./_generated/server";
import { v } from "convex/values";
export const getMessagesByChannel = query({
args: {
channelId: v.id("channels"),
},
handler: async (ctx, args) => {
return await ctx.db
.query("messages")
.withIndex("by_channel", (q) => q.eq("channelId", args.channelId))
.order("desc")
.take(20);
},
});
For more detailed information and additional patterns, refer to the complete reference documentation.
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer