Dedup Plugin

The dedup plugin removes any duplicate pending queries from executing which means you can safely run the same queries at the same time without worrying about excessive requests.

The dedup plugin only applies it's caching logic to queries. Mutations and subscriptions are excluded from the deduplication process.

import { useClient, dedup, fetch } from 'villus';

  use: [dedup(), fetch()],


The dedup plugin is one of the default plugins that are pre-configured with any villus client unless specified otherwise


At this moment the dedup plugin doesn't have any options to customize


You can check the source code for the dedup plugin and use it as a reference to build your own