@hypequery/react

Type-safe React and TanStack Query hooks.

Latest: 0.9.0 · November 9, 2026 · npm · CHANGELOG.md

RSS
0.9.0Minor

Minor changes

  • Type dataset and metric dimension values from InferApiType APIs as what serve actually returns. Numeric dimensions are now number | string | null, because the built-in ClickHouse adapter returns Int64, UInt64 and wider integers as JSON strings to keep their precision. Every dimension, and period, also includes null, because Nullable columns return SQL NULL. Types from generated clients already followed these rules.

    This is a breaking type change. Code that read a numeric dimension as number, or any dimension without handling null, now fails to compile. Convert with Number(value) or BigInt(value) as needed, and check for null.

    a6b4478
0.8.0Minor

Minor changes

  • Requests from a generated client that the server refuses with 409 CLIENT_SCHEMA_CHANGED now throw ClientSchemaChangedError, a subclass of HttpError, whose message says to regenerate the client.

    0f1f056
0.7.1Patch

Patch changes

  • useDataset and useMetric responses type meta as present when the input sets includeMeta: true, and every useInfiniteDataset / useInfiniteMetric page types meta as present, since infinite queries always request it. Responses without includeMeta keep meta optional.

    useDataset and useMetric options now type select against the narrowed response, and the hook's result type follows what select returns.

    edc2fb3
0.7.0Minor

Minor changes

  • Support generated Python client contracts with selection-aware nullable wire results, explicit default measures, metric aliases and endpoint schema headers. Preserve schema pins through route configuration and authentication refresh, and retain declared outputs for ordinary APIs without semantic metadata.

    4736fb3

Patch changes

  • Exclude internal runtime and type-test programs from published package tarballs while preserving public runtime and declaration exports.

    aa10003
0.6.4Patch

Patch changes

  • Support one-hop relationship base measures in dataset queries through the query-builder client. Allow duplicate-insensitive aggregates through belongsTo and all base aggregates through declared hasOne relationships, preserve tenant and fixed-filter scoping, and exclude unmatched target rows from aggregate inputs. Advertise safe names and approximate metadata in runtime catalogs and input schemas, with typed projections through Serve and React.

    9b5b523
  • Preserve dataset filter allowlist names and field-specific operators through dataset and metric queries, Serve API inputs, and React hooks. Generated filters respect filterable: false, and one-hop relationship filters follow the target allowlist. Filter helpers retain operator literals.

    Prevent normal dataset execution from falling through to the legacy dynamic-query overload; explicit result-row generic calls remain supported. Fix Serve in-process execution input inference so its optional schema storage property no longer widens typed inputs to unknown.

    f30add1
0.6.3Patch

Patch changes

  • Refresh production dependencies. Keep the ClickHouse adapter compatible with the client packages' bundled setting types.

    40ac480
0.6.2Patch

Patch changes

  • Expose dataset segments on every query surface. Semantic input schemas, and therefore OpenAPI and the MCP tools, accept segments as an enum of the dataset's declared names. Serve dataset and metric endpoints, and the MCP query_dataset/query_metric tools, forward them to the query. Typed dataset and metric inputs infer declared segment names, including through Serve and React; MCP argument types can opt into a dataset-specific type. Datasets without segments keep their existing schemas.

    b085b08
0.6.1Patch

Patch changes

  • Normalize non-null dataset measure and metric results to strings across query-builder and in-memory execution, preserve SQL nulls, and update public result types to string | null.

    6c1bcb6
0.6.0Minor

Minor changes

  • Add a reusable Hypequery client and React provider for configuring generated hooks once, resolving short-lived bearer tokens per request, refreshing authentication after a 401, and optionally sharing an existing TanStack Query client.

    e587101
0.5.1Patch

Patch changes

  • Refresh every npm package page with a concise README and complete HypeQuery homepage and repository metadata.

    e370da0
0.5.0Minor

Minor changes

  • Type semantic query measure and metric values as string instead of number.

    ClickHouse serializes aggregate results (UInt64, Decimal, ...) as strings over JSON, and the query builder already types aggregation outputs as string. The dataset/metric result row types (DatasetRow, DatasetRowFor, MetricRow, MetricRowFor, and the @hypequery/react hook rows inferred through @hypequery/serve) previously typed those same values as number, so a typed row claimed revenue: number while the runtime handed back "1234.56". The types now match runtime.

    createInMemoryBackend now serializes measure/metric values as strings too, so it stays a faithful double of the ClickHouse backend (values are still computed and ordered numerically — only the emitted columns are stringified).

    Breaking (types only): code that assigned a measure or metric value straight into a number — e.g. const revenue: number = row.revenue — will no longer compile. Parse at the edge instead: Number(row.revenue) (or parseFloat). Dimension values are unchanged; only aggregated measure/metric columns are affected.

    53f6149
0.4.0Minor

Minor changes

  • useInfiniteDataset and useInfiniteMetric now project page row types from the query input, matching useDataset / useMetric. Selected dimensions and measures (and period for grained queries) are typed on data.pages[n].data[m] instead of requiring casts, unselected fields are rejected, and infinite-query options (e.g. select) see the projected page type.

    8ada222
0.3.0Minor

Minor changes

  • Tighten semantic API type inference, add projection-aware dataset and metric result types, preserve projected rows through React analytics hooks, and add static manifest generation for Next.js clients.

    BREAKING (types only, no runtime change): dataset and metric result rows are now projection-typed. DatasetQueryResultFor / MetricResultFor rows — including the output types produced by InferApiType / InferAPIType and the result of createDatasetClient().execute() — no longer expose dimension keys or period unless the query selects them via dimensions / by. Code that read dimension fields off default (non-projected) result types must now pass the projection in the query it executes.

    d7259f0
0.2.0Minor

Minor changes

  • Support authenticated request lifecycles in generated React hooks.

    The headers callback may now be asynchronous and is resolved for every request, allowing short-lived credentials to be supplied. A new onUnauthorized callback can refresh credentials after a 401 response; the request is then retried once with freshly resolved headers.

    75349dd
  • Add a route manifest to bridge serve and react for metric/dataset endpoints.

    @hypequery/serve now exposes api.manifest() (and ServeBuilder.manifest()), a serializable map of every query/metric/dataset key to its { method, path } (full path, including the base path; datasets keyed as dataset:<name>).

    @hypequery/react's createHooks/createAnalyticsHooks accept a manifest option to resolve client routes without importing server code into the bundle. This fixes metric/dataset hooks (POST routes whose paths differ from their map keys) silently defaulting to GET {baseUrl}/{key}. Hooks now also derive routes from a runtime api object via api.manifest(), and throw a clear error when a semantic (dataset:) key has no resolved route instead of calling the wrong URL.

    e64d6f4
  • Add offset pagination with reliable hasMore and infinite-query hooks.

    Metric and dataset queries that specify a limit now return meta.pagination = { limit, offset, hasMore }. hasMore is exact: the executor over-fetches one row (LIMIT n + 1) and trims it, so no separate count query is needed. The extra field is included in the serve endpoints' OpenAPI response schema (surfaced when meta is requested via x-include-meta).

    @hypequery/react adds useInfiniteQuery (and useInfiniteMetric / useInfiniteDataset on createAnalyticsHooks) built on TanStack Query's infinite query. They advance the offset using meta.pagination, automatically requesting meta, so paginating a dataset is just fetchNextPage() until hasNextPage is false.

    Metric endpoints now treat the page-size limit like dataset endpoints: a configurable maxLimit on the metric entry (defaulting to the dataset's limits.maxResultSize, else 1000), with over-limit requests clamped rather than rejected, and a default cap applied so a metric query is never unbounded.

    69b67c0
0.1.1Patch

Patch changes

  • Allow headers to return an empty object and ignore undefined values.

    5c60f20
0.1.0Minor

Minor changes

  • Add per-request header resolvers to React hooks and improve serve multi-tenant ergonomics, ESM-safe startup, and docs alignment.

    e15ce16

Patch changes

  • Ensure the release workflow builds every package before running the Changesets publish step so the CI release ships with fresh dist artifacts.

    ed06077
  • Ensure React package builds on publish by running pnpm build before packing and verifying required dist artifacts.

    651f1c0
0.0.3Patch

Patch changes

  • Republish to ensure the release pipeline builds and ships compiled dist files.

0.0.2Patch

Patch changes

  • Pre-release improvements:

    • CLI loading spinners, serve runtime fixes, and React integration updates
    f99e80e

Get early access to hypequery cloud.

Cloud hosts the same model you run in your backend, with a managed API and MCP server, versions, and rollback. We're letting teams in a few at a time. Join the waitlist and we'll reach out when your project can go live.

How do you want to build your analytics layer? (Optional)
What features do you most need? (Optional)

Pick as many as you like.

Only your email is required. All other questions are optional.