Apollo客户端-在终止链接上调用concat,这将无效

问题描述 投票:0回答:1

我有以下阿波罗链接:

 const link = ApolloLink.from([
    serializingLink,
    httpAuthLink,
    queueLink,
    retryLink,
    errorLink,
    uploadLink,
    httpLink
  ]);

而且它们都具有正确的设置添加新链接后,该错误开始出现在控制台中:

Error: You are calling concat on a terminating link, which will have no effect

通过阅读另一个问题,我发现这可能与数组内部链接的顺序有关。

graphql apollo apollo-client
1个回答
0
投票

终止链接是实际发送请求并接收响应的链接。链的最末端应该只有一个终结链接。在您发布的代码中,至少有两个终止链接-uploadLinkhttpLink。假设使用uploadLink创建了createUploadLink,则无需同时包含它和httpLinkUploadLinkHttpLink的替代品,因此您可以一起删除httpLink

© www.soinside.com 2019 - 2024. All rights reserved.