refactor: improve query key #1
Merged
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.
Add KeyTuple Support and Clean Up Query Key Types
This PR enhances the SwiftUI Query library's type system by adding comprehensive support for
KeyTuple types and removing deprecated query key implementations.
✨ New Features
KeyTuple Support for UseQuery
UseQuerysupportingKeyTuple2,KeyTuple3, andKeyTuple4KeyTuple Support for UseInfiniteQuery
UseInfiniteQuerysupporting all KeyTuple typesUseQueryinitializersDictionary Query Key Support
UseQueryinitializer forDictionary<K,V>query keys🔧 Improvements
Query Key Protocol Enhancement
QueryKeyprotocol conform toEquatablefor better type checking🧹 Cleanup
Removed Deprecated Types
ArrayQueryKeystruct (use nativeArrayextension instead)GenericQueryKeystruct (use native type conformances instead)📊 Test Coverage
Comprehensive Test Suite
KeyTupleTestswith 9 new test cases covering all KeyTuple types🚀 Benefits
🔄 Breaking Changes
ArrayQueryKeyandGenericQueryKeytypesTest Plan
This PR maintains full backward compatibility for users already using String, Array, and custom
types as query keys while adding powerful new KeyTuple support for complex query scenarios.