TypeScriptJQL
Client methods
TypeScript JQL client methods, request options, and transport behavior.
judgeval-js JQL source on GitHub
Public methods
client.query(query, options?: { limit?: number; signal?: AbortSignal }): Promise<JqlQueryResponse>
client.present(presentation, options?: { limit?: number; signal?: AbortSignal }): Promise<JqlPresentationResponse>
client.discover(kind, options?: DiscoveryOptions & JqlRequestOptions): Promise<JqlQueryResponse>| Method | Accepted query | Endpoint behavior | Returns |
|---|---|---|---|
query | Source query, pipeline, or discovery query | Executes structured JQL | JqlQueryResponse |
present | A .table(...) or .chart(...) result | Executes the wrapped query and projects a renderer-neutral frame | JqlPresentationResponse |
discover | A documented discovery kind plus kind-specific options | Builds a discovery IR object, then delegates to query | JqlQueryResponse |
Request option: limit
limit is an integer from 1 through 10,000, validated by the public API. When
omitted, the SDK sends 10,000.
- The request-envelope
limitreplaces any limit inside the JQL object — it is not amin(). Because the public API always sends one, an inner.rows(... limit ...)of 100 is widened to 10,000 unless you also set the method-levellimit. - Set the method-level
limitwhenever you want a smaller result. - The envelope limit is ignored for terminals that do not produce a limitable
result, such as
countandagg. client.discoverforwards itslimitonly as the request cap. To set the IR-level discoverylimit, build the discovery object directly and pass it toclient.query.- An out-of-range
limitis rejected as a400with errorValidation failed, notBAD_QUERY. signalis passed tofetchas anAbortSignal.
Transport
The SDK sends:
{
"query": { "op": "query", "source": "traces", "select": { "op": "ids" } },
"limit": 100
}to the project-scoped query endpoint. present uses a separate
/query/presentation endpoint; discover shares the query endpoint. The SDK
supplies Authorization: Bearer <api key>, the X-Organization-Id header, and
the resolved project ID as a path parameter. The public response never
includes compiled SQL — it is stripped at the API boundary.
Use Responses and errors for the exact success and failure shapes.