Java 如何使用GraphQL中的参数列表创建查询?

Java 如何使用GraphQL中的参数列表创建查询?,java,spring,spring-boot,kotlin,graphql,Java,Spring,Spring Boot,Kotlin,Graphql,我试图创建可以传递多个参数的查询,因此在models.graphqls中添加了以下内容: type Query { productsByParameters(category: String, page: Int, size: Int, parameters: [QueryParameter]): [Product] } 我的解析器看起来像: fun productsByParameters(category: String, page: Int, size: Int, paramet

我试图创建可以传递多个参数的查询,因此在
models.graphqls
中添加了以下内容:

type Query {
    productsByParameters(category: String, page: Int, size: Int, parameters: [QueryParameter]): [Product]
}
我的解析器看起来像:

fun productsByParameters(category: String, page: Int, size: Int, parameters: List<QueryParameter>) 

你知道这里怎么了吗?我遗漏了什么吗?

如果您在kotlin中提供
数组
类型而不是
列表
,它会工作吗?我只是检查一下,如果我切换到
数组
没有任何更改,错误仍然会发生。
Caused by: com.coxautodev.graphql.tools.SchemaClassScannerError: Unable to match type definition (ListType{type=TypeName{name='QueryParameter'}}) with java type (class [Lcom.bd.model.QueryParameter;): Java class is not a List or generic type information was lost: class [Lcom.bd.model.QueryParameter;