Beignet API reference
    Preparing search index...

    Class ReactQueryContractHelper<TContract, TProvidedHeaders>

    TanStack Query helper bound to one Beignet contract.

    The helper intentionally exposes TanStack Query options instead of hiding React Query. Query keys are stable and grouped by Beignet namespace so apps can invalidate a resource or a single contract.

    Type Parameters

    Index
    • get localName(): string

      Contract name without the resource namespace.

      Returns string

    • get name(): string

      Fully qualified contract name.

      Returns string

    • get namespace(): string | null

      Resource namespace used for query-key grouping.

      Returns string | null

    • get route(): string

      Contract route used as the key segment that disambiguates contracts with the same local name, such as /v1/todos and /v2/todos list contracts.

      Returns string

    • Build a stable query key for this contract

      Only includes path/query in the key when they have defined values. This ensures consistent serialization between server (dehydrate) and client (hydrate), since undefined object values may serialize differently across React's RSC boundary vs JSON.stringify.

      Headers are never included unless the adapter opted in with createReactQuery(client, { keyHeaders }), and then only the whitelisted header names are included.

      Parameters

      • Optionalparams: { body?: unknown; headers?: unknown; path?: unknown; query?: unknown }

      Returns ContractQueryKey