apollo-link-mutation-queue (英语)
一个阿波罗链接 来平息突变 使它们不会平行开火.
目标
我发现影响相同基础数据的突变 往往会 返回并行发射的不正确数据。 而不是基于 装入突变状态 我写了一条链接 仅仅 使突变.
使用量
将链条与链条相接.
import MutationQueueLink from "apollo-link-mutation-queue";
const link = ApolloLink.from([
new MutationQueueLink(),
//... your other links
]);
调试 debug: true。 。 。 .
import MutationQueueLink from "apollo-link-mutation-queue";
const link = ApolloLink.from([
new MutationQueueLink({ debug: true }),
//... your other links
]);
按照 skipQueue: true。 。 。 .
const [mutate] = useMutation(MY_MUTATION);
useEffect(() => {
mutate({
context: { skipQueue: true },
});
}, []);
捐款
欢迎捐款! 读取 贡献指南 更多信息.
许可证发放
这个项目根据Apache V2许可证获得许可. 见 自由主义 更多信息.
说明
升级到 @apollo/client 需求 react 财务报告和审定财务报表 react-refresh 作为依赖.