问题描述
嗨,快速的graphQL联邦问题。我有一个在服务 A 中实现的类型 A。我在服务 B 中添加了一个 SomeInterface 类型的字段 interfaceFields。在服务 B 中,我有一个 SomeInterface 的实现。所以我的问题是我可以使用 SomeInterface 的另一个实现创建另一个服务,所以如果我运行这个查询
{
A(search: "test") {
field
interfacFields {
__typename
... on SomeInterfaceImpl1 {
id
}
... on SomeInterfaceImpl2 {
id
}
}
}
}
它将从服务 b 获得 SomeInterfaceImpl1,并从服务 c 获得 someInterfaceImpl2。现在我有这个
服务 A
type Query {
A(Search: String!): A
}
type A @key(fields: "id") {
id: String
}
服务 B
type A @key(fields: "id") @extends {
id: String @external
interfaceFields: [SomeInterface]
}
interface SomeInterface {
id: String!
}
type SomeInterfaceImpl1 implements SomeInterface {
id: String
title: String
}
服务 C
type Page @key(fields: "id") @extends {
slug: String @external
}
interface SomeInterface @extends{
id: String! @external
}
type SomeInterfaceImpl2 implements SomeInterface {
id: String
title: String
}
我收到此错误
GraphQLError:UnkNownType 类型的验证错误:未知类型 SomeInterfaceImpl2 @'_entities/interfaceFields
我只是不知道要为服务 C 做什么,甚至不知道这是否可行。无论如何,任何帮助将不胜感激
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)