【发布时间】:2018-05-20 08:24:14
【问题描述】:
我尝试了几个变体,但没有运气在 GraphQL 中返回地图。所以我有以下两个对象:
public class Customer {
private String name, age;
// getters & setters
}
public class Person {
private String type;
private Map<String, Customer> customers;
// getters & setters
}
我的架构如下所示:
type Customer {
name: String!
age: String!
}
type Person {
type: String!
customers: [Customer!] // Here I tried all combination but had no luck, is there a Map type support for GQL?
}
谁能告诉我如何实现这一点,以便 GraphQL 神奇地处理这个或替代方法。
非常感谢!
【问题讨论】:
标签: java graphql graphql-java