/kavo-skills:query-grammarfrom Kavo Developer Skills
Reference for the query-string grammar used by Kavo API routes — filter operators, sort, field selection, pagination, includes, and security/coercion rules. Useful when constructing requests or documenting API endpoints.
Ships in Kavo Developer Skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Every generated findMany/findOne route (and the programmatic
findMany({ filter, sort, ... }) equivalent) is driven by one query model,
normalized in core/src/query/ (DefaultFilterParser, QueryNormalizer,
PaginationStrategy). This doc is end-user-safe — hand it to an API
consumer as-is. Full source: docs/internals/architecture/05-query-grammar.md
(operators/grammar) and docs/internals/architecture/12-relations-and-includes.md
(includes). What an entity allows through these params is configured via
allowed/relations on @Kavo — see the kavo-decorator skill.
filter[field][operator]=value| AST operator | Wire token | Example |
|---|---|---|
EQ | eq | filter[status][eq]=active |
NE | ne | filter[status][ne]=banned |
GT / GTE | gt / gte | filter[age][gte]=18 |
LT / LTE | lt / lte | filter[age][lt]=65 |
IN | in | filter[status][in]=active,pending |
NOT_IN | notIn | filter[role][notIn]=bot,test |
LIKE | like | filter[name][like]=%25john%25 |
ILIKE | ilike | filter[name][ilike]=%25john%25 |
BETWEEN | between | filter[createdAt][between]=2026-01-01,2026-06-01 |
IS_NULL | isNull | filter[deletedAt][isNull]=true |
IS_NOT_NULL | isNotNull | filter[deletedAt][isNotNull]=true |
Logical operators: AND (implicit), OR, NOT — wire tokens and, or,
not. Wire tokens are camelCase and exact-case matched, no aliases
(GTE/Gte are 400s).
filter[...] params AND together implicitly, including
repeats on the same field: filter[age][gte]=18&filter[age][lt]=65.in/notIn: comma-separated by default (in=active,pending); the
repeated-key form filter[status][in][]=a&filter[status][in][]=b also
works. Capped by limits.inValues (default 100).between: exactly two comma-separated bounds.isNull/isNotNull: boolean-valued; isNull=false ≡
isNotNull=true — both spellings mean what they read as.like/ilike: never auto-wrap wildcards — pass %/_ explicitly.
Literal %/_ escape with a backslash (\%, \_). ilike is portable
(LOWER(col) LIKE LOWER(:v)), identical across drivers. String columns
only.filter[profile.city][eq]=Helsinki),
permitted only on the filterable allowlist. This restricts root rows
via a non-selecting join — it never loads or filters the included
collection.filter also accepts one JSON-encoded value —
?filter={"or":[{"name":{"eq":"admin"}},{"not":{"status":{"eq":"x"}}}]} —
producing the identical AST as the bracket form. Bracket notation is sugar
for the flat common case; JSON is the full-power escape hatch. When both
appear on the same request, they AND together.limits.filterDepth (default 3).GET /users
?filter[age][gte]=18
&filter[status][in]=active,pending
&filter[name][like]=%25john%25
&filter[or][0][role][eq]=admin
&filter[or][1][status][eq]=banned
&sort=-createdAt,name
&limit=20&offset=20
&fields=id,name,email
resolves to:
AND[ age GTE 18, status IN [active, pending], name LIKE "%john%",
OR[ role EQ "admin", status EQ "banned" ] ]
sort: [{ createdAt desc }, { name asc }]
pagination: { limit: 20, offset: 20 }
fields: root: [id, name, email]
sort=-createdAt,nameComma-separated field list; - prefix means descending; list order is
priority order. Enforced against the sortable allowlist — a field not on
it is a 400, not a silent no-op.
fields= / fields[<relation>]=fields=id,name,email — sparse fieldset for the root resource, validated
against the selectable allowlist.fields[<relation path>]=id,title — narrows an included node's own
columns, validated against the target entity's selectable
allowlist (see include below).FieldSelectionInput; its three accepted
spellings collapse to the same normalized selection as the wire form.limit/offset (default) or page[number]/page[size]Pluggable via PaginationStrategy (config key pagination.strategy):
offset (default): flat limit/offset, 0-based — the same field
names the response envelope reports (items, limit, offset, total),
so request and response mirror each other.page (built in): page[number]/page[size], 1-indexed, normalized
internally to limit/offset.limit → pagination.defaultLimit (20). limit above
pagination.maxLimit (100) → clamped, not rejected. Malformed or negative
→ 400.pagination.count: false skips the count query entirely; the envelope
reports total: null — useful for large tables where COUNT(*) is the
expensive part of a list request.paginationStrategies on createKavo/
KavoModule.forRoot.include=posts.comments,profileComma-separated dot-paths, merged into one validated tree. A relation not on
the entity's inclusion allowlist (relations.edges.<name>.includable) is a
400, never a silent omission. Full detail — per-edge strategy
(join/batch/auto), depth/node budgets, the pagination-correctness
guarantee for joined to-many relations, cycle guard, soft-delete interplay,
and relation writes — is in the kavo-decorator skill's "relations" section
and docs/internals/architecture/12-relations-and-includes.md.
withDeleted=trueIncludes soft-deleted rows, which are otherwise excluded from every read;
onlyDeleted=true narrows to them instead. Both need the entity (or the
read) to opt in with delete.allowDeletedReads. Without it, or on an entity
that is not soft-deletable, either is rejected with
KAVO_QUERY_UNSUPPORTED_PARAM (not silently ignored); a non-boolean value is
a field-level 400. Applies to the root only — it never widens what an
included relation returns.
filterable/
sortable/selectable at bootstrap — explicit, or defaulting to the
entity's own scalar columns. Relation paths are never allowlisted
implicitly. Anything outside a list is KAVO_QUERY_INVALID_FIELD (400),
never a silent drop — and programmatic callers get the identical check,
so typed input skips coercion, not security.{ exclude: [...] } in place of an explicit array, resolved at bootstrap
to every own column except the ones named.true/false/1/0, ISO
8601 date, enum member match, null for nullable columns). A coercion
failure is a field-level 400, never a silent NaN/Invalid Date.
Relation-path filter values are not coerced (no column metadata for a
dotted path) and pass through as strings.QueryValidationException
— a client fixes its whole request in one round trip (errors[] in the
problem-details body).What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
kavo, query-grammar, api-query, filter-operators, pagination
npx claudepluginhub kavo-labs/kavo --plugin kavo-skills15 skills in this plugin
/composite-primary-keysReference for composite primary key support in @kavo/typeorm — the compositeIdFields metadata field, the ~-delimited route-id encoding, the creatable/updatable split, and every place composite keys don't yet work (other ORM adapters, many-to-many array-mutation, @kavo/graphql). Use when an entity has more than one @PrimaryColumn, or when a route id, association, or array-mutation write on such an entity behaves unexpectedly./dto-slotsReference for Kavo's six optional schema slots (create/update/patch/query/item/list) — entity-derived defaults, the schemaShapeKeys narrowing rule, and serialization order. Use when configuring a DTO class or validator on @Kavo's schema option, or answering "why isn't my field showing/hiding" or "what shape does this response have" questions./error-handlingReference for Kavo's exception hierarchy, KAVO_* error-code catalog, and the RFC 9457 problem-details wire shape every generated route returns on failure. Use when handling/mapping a Kavo error, deciding which exception to throw from a custom handler/@Override, or answering "what does the error response look like" questions./global-configReference for Kavo's global configuration — the KavoSettings precedence chain, built-in defaults table, KavoModule.forRoot/forRootAsync options, and the operations.<id> global-default caveat (ADR-0015). Use when wiring createKavo/KavoModule.forRoot, setting app-wide defaults, or answering "what can I configure globally" questions./graphql-bindingReference for @kavo/graphql and its Nest binding — building a schema over an existing createCrud service, the raw-AST filter/sort args, multi-entity merging, the process-wide type registry, and the zero-code KavoModule graphql option. Use when exposing an entity over GraphQL, or answering "how do I add GraphQL to this entity" questions./kavo-decoratorReference for what @Kavo(Entity, config?) generates and how to configure/override it — routes table, EntityConfig shape (schema/allowed/operations), manual-method-wins, @Override, and fully custom routes. Use when writing or reviewing a @Kavo-decorated controller, or answering "how do I configure/override this route" questions.Other plugins' skills for the same job