π A tiny and fast GraphQL client for Vue.js
MIT License
Bot releases are hidden (Show)
Villus has been stable for quite some time now aided by its goal to be a minimal GraphQL client for Vue.js and I think after all this time it is safe to say that the API is very stable and happy to go to v1.0 with this which would help anyone who is on the fence of adopting a beta or RC releases.
There is some stuff being experimented with and plans for improving villus, check the PRs and issues for those.
These are changes for this release:
Added paused
option for useSubscription
to start a subscription in lazy mode #142 (#143)
Added volar slot typing support for Query
, Mutation
and Subscription
components (1aec7e727a2b2dee2a3f58708307c91198609f78)
The cache-and-network
cache policy behavior has been changed to update the reactive data
and error
of the useQuery
when the fresh data is fetched from the network, meaning now it will always reflect the fresh data available. #76 (23cd60ba3646b95514af37cd3f174e21f2151867)
fetch
plugin not considering partial data/error responses (6c0a6fa81a57131c9c23758435a1143f3fafd33d)batch
plugin not considering partial data/error respones and properly handle non-200 responses #104 (5cb088df59d0b0d64b71a27b21181a1e50e9e57e)OperationResult
interface #97 (7ba39728e144392de299eb202bb21775d735508a)context
option to useQuery
and useMutation
to support modifying headers on per query basis #96 (8248b06674a4bf2757f0025740d7b775945acc09)useQuery({
query: SomeQuery,
context: {
headers: {
// some headers
}
}
});
// can be reactive as well
useQuery({
query: SomeQuery,
context: computed(() => { .... })
});
useMutation(SomeMutation, {
context: {
headers: {
// some headers
}
}
});
// can be reactive as well
useMutation(SomeMutation, {
context: computed(() => { .... })
});
ExecutionResult
objects #93 (9ced480d387edb8d1d8893cc88d3ae0e856a897c)pause
behavior with subscriptions to not unsubscribe
from the observable when paused, instead it will ignore the result and freeze the state until resume
is called again #94useQuery
suspense API.data
and error
return type to be nullable to reflect real world GQL.variables
option to override query variables on demand (only for a single execution)const { execute } = useQuery();
execute({
variables: {
// ...
}
})
Exposed getQueryKey
helper function to allow including other values into the generated query ids (used for caching and dedup). 26548d575d579bd1cff44c7cbacc93c07e06fee8 5d18e8a7c3016cc9adef0bacfe43076878654a73
useSubscription
now accepts refs for both query
and variables
, and will re-execute the subscription if either change. 0ec46802c80788531a7b84c516eac9d879b076e8