Multiple APIs
One instance per API, shared config viacreateKweriClients, one set of hooks per API. DevTools share a single switchable panel.
Mutation with error handling
Because the default fetcher throws on non-2xx, a failed write lands incatch with err.status and err.detail.
Error handling without try/catch
Queries surface errors reactively, andmutate() (fire-and-forget) sets isError/error without throwing — so most UIs need no try/catch.
kweri.mutate(endpoint, params, { onSuccess, onError }).
List with loading / error / empty states
Optimistic update
Snapshot the cache, apply the change immediately, roll back on failure. (Path hooks don’t take lifecycle callbacks, so do it inline.)Dependent queries
Wait for one query before firing another withenabled. Pass the params as a computed so the dependent query re-runs when the first resolves — a plain object would capture undefined once and never update.
A
computed/ref for params makes the query reactive (it re-fetches when the value changes — the basis for search and pagination too). The as any is currently needed because path-hook param types don’t yet include refs.Per-resource freshness
Different data ages differently — overridestaleTime/cacheTime per call instead of one global.
Search & pagination (reactive params)
Acomputed params object re-fetches whenever it changes. Previously-seen pages stay cached, so paging back is instant.