小编Vil*_*lle的帖子

是否可以有部分联合网关?

我想联合服务,但为了简单起见,让联合网关也拥有自己的模式和逻辑,可以代理 REST API 端点。现在看起来我需要分别拥有联合网关服务、联合 graphql 服务和其余 <->graphql 桥接服务。无论如何,在我们的例子中,rest-graphql 网关至少暂时可以位于联邦网关中,以避免不必要的引导和维护。

看起来阿波罗联邦网关localServiceList似乎正是为了这个目的。一个示例配置:

const gateway = new ApolloGateway({
    serviceList: [
        { name: "some-service", url: "http://localhost:40001/graph" }
    ],
    localServiceList: [
        { name: "rest-bridge", typeDefs }
    ]
});
Run Code Online (Sandbox Code Playgroud)

但它并没有解决问题:如果有 localServiceList,它会跳过 serviceList。

所以问题是:这是否可以在阿波罗联盟网关中保存自己的模式和逻辑?

federation apollo graphql apollo-server apollo-federation

8
推荐指数
1
解决办法
1304
查看次数