返回 HashMap<String, Object> from GraphQL-Java
我尝试了几个变体,没有运气在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 神奇地处理这个或另一种方法。
非常感谢!