refactor(query)!: rename Result option adapters - #136
Merged
Merged
Conversation
…ptions/resultMutationOptions BREAKING CHANGE: the hook-local Result adapters are now named resultQueryOptions and resultMutationOptions. defineQuery/defineMutation and createQueryFactories are unchanged and still compose through them.
Rewrite the query README decision tree around resultQueryOptions/ resultMutationOptions (hook-local/reactive/local-client) vs. defineQuery/defineMutation (reusable/QueryClient-bound/imperative), document that cache operations stay on the QueryClient and are not wrapped, and reframe the naming note now that the result* prefix removes the TanStack name collision. Update the query-factories skill and add a minor changeset (0.44.0).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This renames the hook-local Result adapters in
wellcrafted/queryfromqueryOptions/mutationOptionstoresultQueryOptions/resultMutationOptions.The old names were too close to TanStack Query's own identity helpers, which meant files that used both APIs had to alias one side. The new names describe the adapter boundary: they take
Result-returningqueryFn/mutationFnfunctions and expose TanStack's throwing contract.The higher-level query factories stay the same.
createQueryFactories,defineQuery,defineMutation, and.optionsstill compose through these adapters, so Result unwrapping remains owned in one place.Breaking change:
The query README now documents the intended split: use
resultQueryOptions/resultMutationOptionsfor hook-local, reactive, or local-QueryClientoperations; usedefineQuery/defineMutationfor reusableQueryClient-bound handles with imperative helpers. Cache operations stay onQueryClientand are not wrapped.