New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@adobe/apollo-link-mutation-queue

Package Overview
Dependencies
Maintainers
21
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@adobe/apollo-link-mutation-queue

An apollo link that queues mutations

  • 1.1.0
  • latest
  • npm
  • Socket score

Version published
Maintainers
21
Created
Source

An Apollo link that enqueues mutations so that they do not fire in parallel.

Goals

I was finding that mutations affecting the same underlying data would often return incorrect data if fired in parallel. Instead of blocking UI based on the loading state of the mutations I wrote a link that just enqueues mutations.

Usage

Compose your link chain with the link.

import MutationQueueLink from "apollo-link-mutation-queue";

const link = ApolloLink.from([
  new MutationQueueLink(),
  //... your other links
]);

Debug with debug: true.

import MutationQueueLink from "apollo-link-mutation-queue";

const link = ApolloLink.from([
  new MutationQueueLink({ debug: true }),
  //... your other links
]);

Cut in line with skipQueue: true.

const [mutate] = useMutation(MY_MUTATION);

useEffect(() => {
  mutate({
    context: { skipQueue: true },
  });
}, []);

Contributing

Contributions are welcomed! Read the Contributing Guide for more information.

Licensing

This project is licensed under the Apache V2 License. See LICENSE for more information.

Note

The upgrade to @apollo/client requires react and react-refresh as dependencies.

Keywords

FAQs

Package last updated on 03 May 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc