Class DgsGraphQlClient
java.lang.Object
org.springframework.graphql.client.DgsGraphQlClient
Simple wrapper around a 
GraphQlClient that prepares the request
 from classes generated with the
 DGS Code Generation library.
 
 GraphQlClient client = ... ;
 DgsGraphQlClient dgsClient = DgsGraphQlClient.create(client);
 List<Book> books = dgsClient.request(new BooksGraphQLQuery())
                .projection(new BooksProjectionRoot<>().id().name())
                .retrieveSync()
                .toEntityList(Book.class);
 - Since:
- 1.3.0
- Author:
- Rossen Stoyanchev
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionfinal classDeclare options to gather input for a GraphQL request and execute it.
- 
Method SummaryModifier and TypeMethodDescriptionstatic DgsGraphQlClientcreate(GraphQlClient client) Create instance that wraps the givenGraphQlClient.Return the wrappedGraphQlClientto delegate to.request(com.netflix.graphql.dgs.client.codegen.GraphQLQuery query) Start defining a GraphQL request for the givenGraphQLQuery.
- 
Method Details- 
getGraphQlClientReturn the wrappedGraphQlClientto delegate to.
- 
requestpublic DgsGraphQlClient.RequestSpec request(com.netflix.graphql.dgs.client.codegen.GraphQLQuery query) Start defining a GraphQL request for the givenGraphQLQuery.- Parameters:
- query- the GraphQL query
 
- 
createCreate instance that wraps the givenGraphQlClient.- Parameters:
- client- the client to delegate to
 
 
-