java - Java GraphQL dgs 客户端
问题描述
我使用 graphql dgs 客户端使用以下查询。我已经使用 com.netflix.graphql.dgs.client.codegen.GraphQLQueryRequest 实现了第一个查询,其中我创建了一个下面给出的根对象和一个 tocResourceGraphQLQuery 要在我的 GraphQLQueryRequest graphQLQueryRequest = new GraphQLQueryRequest(tocResourceGraphQLQuery, root); 但我不知道如何使用 dgs 客户端在查询中实现查询。
TocResourceProjectionRoot root = new TocResourceProjectionRoot().data().title().id()
.identifier().getParent().items().data().id().identifier().getParent().type().displayId()
.orderNo().title().availabilityTypes().getRoot();
query {
tocResource(
context: {
identifier:"urn:sbnet:book:tca1e_sbtest-1", type:"book" },
identifier:{
identifier:"urn:sbnet:book:tca1e_sbtest-1:chapter:2:section:1",
type:"section" })
{
data {
title
id {
identifier
}
items(**query**: {
filter: {isAccessible: true,availabilityTypes: [StudyPlan]},
paginationAndSorting: {offset: 0, limit:10}
}) {
data {
title
id {
identifier
}
type
displayId
orderNo
availabilityTypes
}
}
}
}
}
解决方案
推荐阅读
- c# - Xamarin.Forms 应用程序在启动时冻结(startupWork.ContinueWith 问题)
- java - Hibernate 无法使用 h2 数据库进行逆向工程
- css - [meteor]如何将合并后的css文件放在头部底部?
- r - 使用matlib + rgl时vector3d()图形中的奇怪对象
- c# - 无法在 Ntier 结构中创建 EF 数据库
- tensorflow - 如何更改 TensorFlow 嵌入层中的 input_length?
- c++ - fputs 更改已保存,但新更改恢复以前的更改
- javascript - 为什么 toString.split(" ") 给了我一个包含 3 个迷你数组的变量,每个数组的长度属性为 1?
- python - 如何根据另一个字典查找和替换一个字典中的值
- python - RASA NLU 过拟合实体提取