villus

🏎 A tiny and fast GraphQL client for Vue.js

MIT License

Downloads
2.5K
Stars
789
Committers
23

Bot releases are hidden (Show)

villus -

Published by logaretm almost 3 years ago

⚙️ Misc

Updated graphql dependency to support v16 #144 (34313e35b079213b155e47637d9c2056d5d95b4f)

villus -

Published by logaretm about 3 years ago

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)

🦖 TypeScript

Added volar slot typing support for Query, Mutation and Subscription components (1aec7e727a2b2dee2a3f58708307c91198609f78)

villus -

Published by logaretm about 3 years ago

🐛 Bug Fixes

  • batch handled failure when attempting to unbatch a non-JSON or empty responses, it should provide a new custom error instead. This is observed when servers running nginx return 502 randomly.
villus -

Published by logaretm about 3 years ago

🦖 TypeScript

  • Changed the interface of ObserverLike to have optional callbacks to match other implementations in the wild closes #132 (2ecd80b995f4af235f25f1fc009f1e3719733d8c)
villus -

Published by logaretm about 3 years ago

🆕 New Features

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)

villus -

Published by logaretm over 3 years ago

🦖 TypeScript

  • Updated the return result of Client.executeQuery and Client.executeMutation to include the query type #128 (80426e21c98301d9896f814e94c106a1374cd385)
villus -

Published by logaretm over 3 years ago

💀 Breaking changes

  • Dropped Vue 2 support, for now. to better focus on the full reactivity features of Vue 3
villus -

Published by logaretm over 3 years ago

🐛 Bug Fixes

  • normalize the multipart queries that caused the query to send ASTs #112 (#113) (c54fd0e)
villus -

Published by logaretm over 3 years ago

🦖 TypeScript

  • Exposed plugin types #105 (a9b62de2e24fba25c26cbf3527606d6f258a8b4c)
villus -

Published by logaretm over 3 years ago

🐛 Bug Fixes

  • Fixed a race condition causing queries and mutation state integrity issues (43d936b91a407af0e3e83a1f1a1c81dbb00d0806)
villus -

Published by logaretm over 3 years ago

🐛 Bug Fixes

  • Fixed the default fetch plugin not considering partial data/error responses (6c0a6fa81a57131c9c23758435a1143f3fafd33d)
  • Fixed the batch plugin not considering partial data/error respones and properly handle non-200 responses #104 (5cb088df59d0b0d64b71a27b21181a1e50e9e57e)
villus -

Published by logaretm over 3 years ago

🦖 TypeScript

  • Exposed the OperationResult interface #97 (7ba39728e144392de299eb202bb21775d735508a)

🆕 New Features

  • Added 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(() => { .... })
});
villus -

Published by logaretm over 3 years ago

🦖 TypeScript

  • Fixed typing issue with Subscription forwarder type not accepting standard GraphQL ExecutionResult objects #93 (9ced480d387edb8d1d8893cc88d3ae0e856a897c)

🐛 Bugs Fixed

  • Fixed an issue where subscriptions did not report query errors correctly #93 (9ced480d387edb8d1d8893cc88d3ae0e856a897c)

💖 Enhancements

  • Tweaked the 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 #94
villus -

Published by logaretm almost 4 years ago

🦖 Types

  • Enhanced the return type from the useQuery suspense API.
  • Enhanced the data and error return type to be nullable to reflect real world GQL.

🆕 New Features

  • added variables option to override query variables on demand (only for a single execution)
const { execute } = useQuery();

execute({
  variables: {
     // ...
   }
})
villus -

Published by logaretm almost 4 years ago

🐛 Bug Fixes

  • fixed an issue where batch requests did not handle network errors correctly #86
villus -

Published by logaretm almost 4 years ago

🆕 New Features

  • added install method to the villus client instance to make it installable as a Vue plugin #81 (#83) thanks to @sibbng
villus -

Published by logaretm almost 4 years ago

🆕 New Features

  • 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

villus -

Published by logaretm almost 4 years ago

🆕 New Features

  • Exposed definePlugin type helper to make creating plugins easier 6f79a97b040f132cdbea97a7e6050043f21b2195
villus -

Published by logaretm almost 4 years ago

New Features 🆕

  • added initialIsFetching for useQuery composable function ea043da2a4d25c81e772c2a8b9a8c9ddf33e6680
villus -

Published by logaretm almost 4 years ago

🐛 Bug Fixes

  • fixed an issue where provides property is not available on a Vue instance 73efd25399988ea3615e208fff16ef8fbcd5d7e1