如何将GraphqlSchema转换为联合模式?

时间:2020-04-01 05:56:19

标签: graphql apollo-server apollo-federation

当我将现有的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。除此之外,还有其他选择吗?

1 个答案:

答案 0 :(得分:0)

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