0

I have the below query to be consumed using graphql dgs client. I have implemented the first query using com.netflix.graphql.dgs.client.codegen.GraphQLQueryRequest in which I have created a root object given below and a tocResourceGraphQLQuery to be passed in my GraphQLQueryRequest graphQLQueryRequest = new GraphQLQueryRequest(tocResourceGraphQLQuery, root); But I don't know how to implement the query inside the query using dgs client.

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
            }
    }
}
}

}

  • 1
    Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Oct 25 '21 at 21:51
  • I am not able to figure out a way to run the second query from within first queryusing dgs client codegen framework. with filter inside i.e items query: { filter: {isAccessible: true,availabilityTypes: [StudyPlan]}, paginationAndSorting: {offset: 0, limit:10} I have used it as a reference so far https://netflix.github.io/dgs/advanced/java-client/ – user3306895 Oct 26 '21 at 11:57

0 Answers0