0.1.1
What's Changed
New Features
Observer-level cache options
QueryState, PaginatedQueryState, and InfiniteQueryState now accept a cacheOptions parameter. This lets each observer define its own staleTime and
gcTime independently of the client defaults. Two views watching the same key can have different stale thresholds, and the last subscriber's gcTime
controls when inactive data is removed.
@QueryBinding(
cacheOptions: QueryCacheOptions(staleTime: 120)
) private var repositories: QueryState<[Repository], [Repository]>
QueryState convenience accessors
data, error, isPending, isFetching, isSuccess, and isError are now available directly on QueryState. Accessing result is only needed for less common
properties like isStale or isPlaceholderData.
// before
if queryState.result?.isPending == true { ... }
// after
if queryState.isPending { ... }
Bug Fixes
- Fixed queryClient environment not being written through the correct backing key, causing the value to not propagate to child views in some configurations.
- Fixed a crash when SwiftUI adapters were used without .queryClient(...) in the environment — now terminates with a clear fatalError message instead of a
silent misbehavior.