【发布时间】:2021-08-19 04:14:02
【问题描述】:
我正在努力学习 Apollo Federation,因此我首先查看了他们的示例 (https://github.com/apollographql/federation-demo)。这个示例存储库很好用,我可以在 Node.js 中添加一个新服务作为子图。
我还想在 .NET Core 中添加一个新服务作为子图,以扩展示例项目中定义的 User 类型。为此,我使用 graphql-dotnet 创建了一个新服务。
我的架构定义如下:
extend type User @key(fields: "id") {
id: ID! @external
phone: String
}
GraphQL Playground 似乎工作正常,但是当我尝试将服务包含在我的网关中时,我收到以下错误:UnhandledPromiseRejectionWarning: Error: Couldn't load service definitions for "user-service" at http://localhost:5000/graphql: Syntax Error: Expected Name, found "}".
【问题讨论】:
标签: node.js asp.net-core graphql apollo apollo-federation