Skip to content

Releases: logaretm/villus

v2.1.1

08 Feb 00:43
Compare
Choose a tag to compare

πŸ› Bugs Fixed

  • Subscription forwarder not receiving a nomralized query string (7a50249) #188

πŸ‘• TypeScript

  • Changed the internal ObserverLike interface to require next and error and complete functions. This makes it more compatible with graphql-ws sink type which is the recommended WebSocket implementation (0c91f11) #154 #186

v2.1

30 Dec 18:34
Compare
Choose a tag to compare

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

28 Dec 15:56
Compare
Choose a tag to compare

πŸ‘• TypeScript

  • Fixed a couple of typing issues with useMutation and its execute() where the data and error values returned were not nullable #182 (#183)

v2.0.1

23 Oct 05:37
Compare
Choose a tag to compare

βš™οΈ Misc

  • Exposed several network utilities to make creating fetch plugins easier, the exposed functions are mergeFetchOptions, makeFetchOptions and parseResponse #163 (47348e1)

v2.0

07 Aug 15:17
Compare
Choose a tag to compare

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

31 Jul 23:34
Compare
Choose a tag to compare

πŸ› Bug Fixes

  • Fixed an issue with batch plugin dropping some fetch options set by previous plugins #166 (#167) thanks to @DaLukasTI

v1.2.4

11 Jul 01:34
Compare
Choose a tag to compare

πŸ‘• TypeScript

  • Exposed GraphQLResponse and ParsedResponse types.

v1.2.3

03 Jul 20:20
Compare
Choose a tag to compare

πŸ†• New Features

  • Added maxOperationCount option to the batch 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

v1.2.2

03 Jul 20:12
Compare
Choose a tag to compare

πŸ› Bug Fixes

  • Fixed not being able to resolve global fetch when in worker context #160 (#161) thanks to @bravik

v1.2.1

06 Jun 07:27
Compare
Choose a tag to compare

πŸ› Bug Fixes

  • Fixed isFetching not being set to false if the query was skipped via skip option.