Apollo 客户端 - 在终止 link 时调用 concat,这将无效
Apollo Client - Calling concat on a terminating link, which will have no effect
我有以下 Apollo 链接:
const link = ApolloLink.from([
serializingLink,
httpAuthLink,
queueLink,
retryLink,
errorLink,
uploadLink,
httpLink
]);
并且它们都具有正确的设置
添加新的 link 后,该错误开始出现在控制台中:
Error: You are calling concat on a terminating link, which will have no effect
看了另外一个issue,发现这可能与数组中link的顺序有关。
终止 link 是实际发送请求并接收响应的终止。在你的链的最后应该只有一个终止 link 。在您发布的代码中,至少有两个终止 links -- uploadLink
和 httpLink
。假设 uploadLink
是使用 createUploadLink
创建的,则无需同时包含它和 httpLink
。 UploadLink
是 HttpLink
的替代品,因此您可以将 httpLink
一起删除。
我有以下 Apollo 链接:
const link = ApolloLink.from([
serializingLink,
httpAuthLink,
queueLink,
retryLink,
errorLink,
uploadLink,
httpLink
]);
并且它们都具有正确的设置 添加新的 link 后,该错误开始出现在控制台中:
Error: You are calling concat on a terminating link, which will have no effect
看了另外一个issue,发现这可能与数组中link的顺序有关。
终止 link 是实际发送请求并接收响应的终止。在你的链的最后应该只有一个终止 link 。在您发布的代码中,至少有两个终止 links -- uploadLink
和 httpLink
。假设 uploadLink
是使用 createUploadLink
创建的,则无需同时包含它和 httpLink
。 UploadLink
是 HttpLink
的替代品,因此您可以将 httpLink
一起删除。