我是GraphQL和graphql-java的新手。 我有一个架构,其中的字段来自两个(或多个)服务。 模式看起来像这样。
type Payload {
price: Price
}
type Price {
sellerPrice: String
offerPrice: String
}
sellerPrice
来自以下JSON格式的一项服务
{
seller": {
"seller_price": "10.00"
}
}
offerPrice
来自另一服务,格式如下。
{
"offer": {
"offer_price": "8.00"
}
}
我正在努力弄清如何创建一个解析器,该解析器将根据请求的属性(sellerPrice和/或offerPrice)自动解析服务。 预先谢谢你。