A typed client for the Kirby Query Language (KQL): every query has a result type that matches exactly what the KQL endpoint returns.
Query: A request object sent to the KQL endpoint, made of a query string and an optional select. Avoid: Request, KQL object
Query string:
The dotted method chain inside a query, such as page.director.toPage, read from left to right starting at a class.
Avoid: Path, expression
Select: The part of a query that picks which keys of the current value appear in the result, given as a record, a list of keys, or a comma-separated string. Avoid: Fields, projection
Select without a query string:
An entry of a record select written as { select }: it reads its key from the current object and selects from that, and takes its pagination from options.pagination, not from a pagination key. In the code, KeySelect.
Avoid: Sub-select, shorthand query
Result: The JSON value the KQL endpoint returns for a query, and the type the client assigns to it. Avoid: Response, data
Paginated result:
The result of a collection with a select that has a pagination, from the query's pagination key or from paginate() in the query string: its items wrapped as { data, pagination }.
Avoid: Paged response, page wrapper
Default fields: The keys a class renders when a query selects nothing from it. Avoid: toArray fields, default select
Schema: The description of everything KQL can reach: its classes, each class's methods and what they return, and each class's default fields. Avoid: Registry, type map, manifest
Class:
One kind of value in the schema, named by its KQL alias, such as page, files, field or block.
Avoid: Model, type, interceptor
Content field: A key on a page, site, file, user, block or structure item that is not a method, and therefore reads that model's stored content as a string. Avoid: Custom field, blueprint field
Schema extension: Classes, methods and block types a project adds to the schema to describe what its plugins and blueprints provide. Avoid: Custom types, plugin types, registration
Unknown method: A method on a class other than page, site, file, user, block or structure item that neither the schema nor a schema extension describes; its result, and everything after it in the query string, is unknown, or, on a strict client, the query is impossible. On those classes the same key is a content field instead. Avoid: Custom method, unregistered method
Impossible query:
A query KQL can never answer: a query string that doesn't parse, a root no schema declares, or a method on a string, number or boolean, anywhere in the query. It is a compile error at the query, and its result type is never.
Avoid: Invalid query, broken query
Strict:
The opt-in client option under which an unknown method makes the query impossible instead of unknown. In the code, a schema with strict on is a StrictSchema.
Avoid: Strict mode, exact mode
Stored content:
The content of a block or layout as Kirby saves it, each value as the JSON type its field stores (a files field as a list of UUIDs, a toggle as the string 'true' or 'false'), which is how it renders without a select. Through a select, the same value is a content field.
Avoid: Raw content, block data
Block type:
One kind of block, named by the block's type, together with the stored content it holds. It is not a class: every block is of the class block, whatever its block type.
Avoid: Block kind, fieldset, block definition
Core block: A block type that Kirby itself ships, such as heading, text or image, and that every site has unless the project removes it. Avoid: Default block, built-in block, standard block
Custom block: A block type a project adds in its schema extension, or a core block it redefines there. Avoid: Plugin block, registered block
Block union: The closed set of block types a site's blocks can have: the core blocks plus the custom blocks, minus the core blocks the project removes. There is one per site, shared by every blocks field and every layout. Avoid: Block list, AnyBlock
Test site: The small Kirby installation inside this repo that exists only to answer test queries and to generate the schema from. Avoid: Demo instance, demo site, backend
Test query: A query kept in the repo whose result type is checked against what the test site really returns. Avoid: Example query, sample
Case: One of several queries that make up a single test query, such as the same query on filled and on empty content. Every case must have the same result type, and it must equal the observed type of all their fixtures merged. Avoid: Variant, scenario
Fixture: The recorded result of one test query from the test site. Avoid: Snapshot, recording, response