groq-builder
Version:
A **schema-aware**, strongly-typed GROQ query builder. It enables you to build GROQ queries using **auto-completion**, **type-checking**, and **runtime validation**.
15 lines (14 loc) • 463 B
TypeScript
import { SchemaDocument } from "../types/schema-types";
declare module "../groq-builder" {
interface GroqBuilder<TResult, TQueryConfig> {
/**
* Selects all documents, via GROQ's `*` selector.
* This is how most queries start.
*
* @example
* q.star.filter(...).project(...)
*
*/
star: GroqBuilder<Array<Extract<TQueryConfig["schemaTypes"], SchemaDocument>>, TQueryConfig>;
}
}