【问题标题】:How to convert GraphqlSchema into a Federation Schema?如何将 GraphqlSchema 转换为联合模式?
【发布时间】:2020-07-12 19:48:42
【问题描述】:

当我将现有的 GrpahqlSchema 传递给 buildFederatedSchema 时,我遇到了错误

Cannot read property 'kind' of undefined

这是因为当我将 GrpahqlSchema 传递给 buildFederatedSchema 时,它的验证失败。

 at Object.validateSDL (/Users/alti/Projects/woundtech/woundtech-fhir-graphql/node_modules/graphql/validation/validate.js:62:24)
at Object.buildSchemaFromSDL (/Users/alti/Projects/woundtech/woundtech-fhir-graphql/node_modules/apollo-graphql/lib/schema/buildSchemaFromSDL.js:36:31)
at buildFederatedSchema (/Users/alti/Projects/woundtech/woundtech-fhir-graphql/node_modules/@apollo/federation/dist/service/buildFederatedSchema.js:32:35)

https://github.com/apollographql/apollo-server/pull/3013 有一个公开的 PR。有没有其他选择?

【问题讨论】:

    标签: graphql apollo-server apollo-federation


    【解决方案1】:

    您可能在不同的 graphql 模式中有同名的类型。

    【讨论】:

      猜你喜欢
      • 2018-10-13
      • 1970-01-01
      • 2017-01-01
      • 2022-01-18
      • 2020-04-02
      • 2011-01-09
      • 1970-01-01
      • 2020-01-17
      • 2013-03-06
      相关资源
      最近更新 更多