Skip to content
effect-api-query

Feature Support

Choose the RPC or HTTP adapter and find its supported TanStack Query features.

effect-api-query creates TanStack Query options and cache keys from Effect RPC groups and HttpApi definitions. Use createRpcQueryUtils for RPC and createHttpApiQueryUtils for HTTP, both imported from the package root.

The capability matrix compares RPC and HTTP support in separate columns. It shows what the package generates, which integrations are tested, what your application must supply, which operations are deferred, and where upstream libraries provide no integration point.

Use ordinary queries for cached reads, infinite queries for pagination, and mutations for commands. Both adapters generate these builders for every retained unary operation, so choose the one that fits each call. Writes refresh cached reads only when your application invalidates the affected keys.

RPC streams also have streamedOptions to accumulate values and liveOptions to retain the latest value. HTTP streams, multipart uploads, and raw-response modes are deferred. The factory omits an HTTP endpoint from the generated utility tree if it has any streaming success or multipart request alternative.

Acquire the ready client, configure transport and authentication, and own its runtime before constructing utilities. Keep those resources alive while queries and mutations use them. Configure TanStack providers, Devtools, persistence, broadcasting, and cache defaults in your application.

Include a safe user or tenant identity in keyPrefix whenever client configuration changes the returned data. Keep credentials out of keys. See semantic keys and client lifecycle.

Start with the RPC tutorial or HTTP tutorial, then use the shared guides for conditional queries, cache management, and cancellation.