Repository navigation
Minor Changes
-
b56ade1: Rename the hook-local Result adapters:
queryOptions→resultQueryOptionsandmutationOptions→resultMutationOptions.Breaking change. Update imports and call sites:
-import { queryOptions, mutationOptions } from "wellcrafted/query"; +import { resultQueryOptions, resultMutationOptions } from "wellcrafted/query";
createQueryFactories,defineQuery, anddefineMutationare unchanged — they still compose through the renamed adapters, so there is still exactly one place that unwrapsResultinto TanStack's throwing contract.Why: the old names collided with TanStack Query's own
queryOptions/mutationOptionsidentity helpers. Theresult*prefix removes that collision and names what the adapters do — adapt aResult-returningqueryFn/mutationFn— so both can coexist in one file without aliasing.This clarifies the two-family model:
resultQueryOptions/resultMutationOptions— hook-local, reactive, or local-QueryClientoperations passed straight to a framework hook.createQueryFactories(...).defineQuery/defineMutation— reusable,QueryClient-bound handles with imperative helpers (.fetch,.ensure, callable mutations).
Cache operations (
invalidateQueries,setQueryData,ensureQueryData, …) stay on theQueryClientand are intentionally not wrapped.