3

我正在尝试使用 apollo 托管解决方案中的托管配置在本地运行 apollo 网关。它加载了架构,一切都很好,但是当我在操场上尝试查询时,我得到“仅支持 HTTP(S) 协议”。我知道我可以使用 serviceList,但我希望能够在本地为带有阿波罗图管理器的 POC 运行它。这似乎是 apollo 使用的 node-fetch 的一个问题,因为它甚至不调用底层数据源并且在网关处失败。

在此处输入图像描述

/* istanbul ignore file */
import {ApolloServer} from 'apollo-server';

import {ApolloGateway} from '@apollo/gateway';

 const {
   NODE_ENV,
 } = process.env;


 const gateway: ApolloGateway = new ApolloGateway();

 const main = async () => {
    return new ApolloServer({
        gateway,
        playground: NODE_ENV !== 'production',
        subscriptions: false,
 });
}

export default main;

我在网上到处搜索,似乎找不到答案,所以任何帮助将不胜感激。任何想法如何在本地工作?提前致谢。

4

0 回答 0