0

Apollo GraphQL 网关模块中似乎有一个错误

我正在尝试使用以下文档 https://docs.nestjs.com/graphql/federation#sharing-context进行 PoC

使用命令“npm run dev”时出现以下错误。

让我知道解决方案......我使用 NodeJS 16.x 和 NestJS 8.1.2

node_modules/@apollo/gateway/src/make-fetch-happen.d.ts:58:18 - error TS2300: Duplicate identifier 'fetch'.

58   export default fetch;
                    ~~~~~

  node_modules/@nestjs/graphql/node_modules/@apollo/gateway/src/make-fetch-happen.d.ts:58:18
    58   export default fetch;
                        ~~~~~
    'fetch' was also declared here.

node_modules/@apollo/query-planner/dist/composedSchema/metadata.d.ts:13:9 - error TS2717: Subsequent property declarations must have the same type.  Property 'federation' must be of type 'FederationFieldMetadata', but here has type 'FederationFieldMetadata'.

13         federation?: FederationFieldMetadata;
           ~~~~~~~~~~

  node_modules/@nestjs/graphql/node_modules/@apollo/query-planner/dist/composedSchema/metadata.d.ts:13:9
    13         federation?: FederationFieldMetadata;
               ~~~~~~~~~~
    'federation' was also declared here.

node_modules/@nestjs/graphql/node_modules/@apollo/gateway/src/make-fetch-happen.d.ts:58:18 - error TS2300: Duplicate identifier 'fetch'.

58   export default fetch;
                    ~~~~~

  node_modules/@apollo/gateway/src/make-fetch-happen.d.ts:58:18
    58   export default fetch;
                        ~~~~~
    'fetch' was also declared here.

[12:44:29 PM] Found 3 errors. Watching for file changes.

4

0 回答 0