Releases: logaretm/villus
v2.1.1
π Bugs Fixed
π TypeScript
v2.1
A couple of nice features to help with the caching and fetching logic of mutations and queries. As always, feedback is welcome and make sure to report any bugs you encounter.
π New Features
Added the ability to tag queries using the tags
option when calling useQuery
. This marks a query with the specified tags for a couple of features.
Clearing tagged queries cache after mutation
const { data } = useQuery(GetPosts, {
tags: ['all_posts'],
});
// This will clear the previous query cache whenever `execute` concludes successfully.
const { execute } = useMutation(CreatePost, {
clearCacheTags: ['all_posts'],
});
Refetching tagged queries cache after mutation
const { data } = useQuery(GetPosts, {
tags: ['all_posts'],
});
// This will auto-fetch the previous query whenever `execute` concludes successfully.
const { execute } = useMutation(CreatePost, {
refetchTags: ['all_posts'],
});
This refetching bypasses the cache so it will also clear the affected queries cache as well, so there is some overlap between clearing and autofetching.
v2.0.2
v2.0.1
v2.0
A new major release of villus
with Vue 2.7 support and API improvements.
Vue 2.7 Support π
Villus now supports Vue 2.7+ releases, so go ahead and try it out in your Vue 2.7 projects!
π Breaking Changes
Dropping higher-order components
Villus is now strictly a composition API library, the higher-order components were dropped in favor of a lighter footprint and compatibility with Vue 2.7 due to differences in VDOM API.
The Higher-order components API was mostly around for compatibility purposes and wasn't documented properly to encourage using the composition API.
Pausing Queries/Subscriptions
The API for stopping auto-refetch behaviors was changed. Instead of having explicit resume
and pause
functions you could pass a boolean, function that returns a boolean or a boolean ref.
Here are a few examples of how that works now:
const { data } = useQuery({
query: GetPostById,
variables,
// Don't re-fetch automatically unless the id is present
paused: ({ id }) => !id,
})
const { data, execute } = useQuery({
query: GetPostById,
variables,
// This query is now "lazy" and you have to trigger executions manually with `execute`.
paused: true,
});
The docs offer more examples and use cases for this API.
Aside from that, it also offers a clear distinction from the recently introduced skipped queries.
v1.2.5
v1.2.4
v1.2.3
π New Features
- Added
maxOperationCount
option to thebatch
plugin to allow fine control over how many queries can be executed in a batch. Docs
π Bug Fixes
- Fixed calling
query.unwatchVariables()
can error out if variables are not watched by default (#164) thanks to @callumacrae