graphql-java - Graphql-java 是否支持对象数组作为复杂对象的查询参数?
问题描述
我目前正在使用 java spring-boot 实现 graphql。作为示例,我有如下架构:
type Book {
id:ID
name:String
author:[Author]
publisher:Publisher
}
type Author {
authorId:ID
authorName:String
}
type Publisher. {
publisherId:ID
publisherName:String
}
以上都是通过下面独立的rest api来获取的。我需要获取一系列书籍。
我总是可以对每本书进行独立查询:
eg:query {
_678:bookbyId(id:678) {
id
name
author {
id
}
publisher {
id
}
_679:bookbyId(id:679 ){
id
name
author {
id
}
publisher {
id
}
}
但是有没有更好的查询方式
bookbyId([id:678,id:679]){
id
name
author {
id
}
publisher {
id
}
如果是,我如何处理作者和出版商到正确书籍的映射?
解决方案
推荐阅读
- postgresql - Golang Postgres Squirrel 语法错误 (SQLSTATE 42601)
- r - 如何使用 processR 包调整有节制的调解模型?
- python - 如何在该程序中实施财务功能?
- javascript - Axios 不向表中插入值
- python - 使用 Python 获取一些受保护文件系统窗口的副本?
- swiftui - 无法检索区域信息 - 监控不起作用
- c++ - 为什么编译器允许默认构造函数使用引用成员初始化类
- flex-lexer - 带有自动机的柔性扫描仪推回溢出
- java - Tomcat 服务器无响应“http-nio-80-Acceptor-0”
- python - 可能导致此错误的原因:UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 568: invalid start byte