Package org.forum.server.specific_code
Class DataFetchersDelegateQueryImpl
java.lang.Object
org.forum.server.specific_code.DataFetchersDelegateQueryImpl
- All Implemented Interfaces:
DataFetchersDelegateQuery
@Component
public class DataFetchersDelegateQueryImpl
extends Object
implements DataFetchersDelegateQuery
- Author:
- etienne-sf
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboards
(graphql.schema.DataFetchingEnvironment dataFetchingEnvironment) This method loads the data for Query.boards.findTopics
(graphql.schema.DataFetchingEnvironment dataFetchingEnvironment, String boardName, List<String> keyword) This method loads the data for Query.findTopics.nbBoards
(graphql.schema.DataFetchingEnvironment dataFetchingEnvironment) This method loads the data for Query.nbBoards.This method loads the data for Query.topics.
-
Constructor Details
-
DataFetchersDelegateQueryImpl
public DataFetchersDelegateQueryImpl()
-
-
Method Details
-
boards
Description copied from interface:DataFetchersDelegateQuery
This method loads the data for Query.boards. It may return whatever is accepted by the Spring Controller, that is:- A resolved value of any type (typically, a List<org.forum.server.graphql.Board>)
- Mono and Flux for asynchronous value(s). Supported for controller methods and for any DataFetcher as described in Reactive DataFetcher. This would typically be a Mono<List<org.forum.server.graphql.Board>> or a Flux<List<org.forum.server.graphql.Board>>
- Kotlin coroutine and Flow are adapted to Mono and Flux
- java.util.concurrent.Callable to have the value(s) produced asynchronously. For this to work, AnnotatedControllerConfigurer must be configured with an Executor. This would typically by a Callable<List<org.forum.server.graphql.Board>>
- A CompletableFuture<?>, for instance CompletableFuture<List<org.forum.server.graphql.Board>>. This allows to use graphql-java java-dataloader to highly optimize the number of requests to the server. The principle is this one: The data loader collects all the data to load, avoid to load several times the same data, and allows parallel execution of the queries, if multiple queries are to be run.
- A Publisher (instead of a Flux), for Subscription for instance
- Specified by:
boards
in interfaceDataFetchersDelegateQuery
- Parameters:
dataFetchingEnvironment
- The GraphQLDataFetchingEnvironment
. It gives you access to the full GraphQL context for this DataFetcher
-
nbBoards
Description copied from interface:DataFetchersDelegateQuery
This method loads the data for Query.nbBoards. It may return whatever is accepted by the Spring Controller, that is:- A resolved value of any type (typically, a java.lang.Integer)
- Mono and Flux for asynchronous value(s). Supported for controller methods and for any DataFetcher as described in Reactive DataFetcher. This would typically be a Mono<java.lang.Integer> or a Flux<java.lang.Integer>
- Kotlin coroutine and Flow are adapted to Mono and Flux
- java.util.concurrent.Callable to have the value(s) produced asynchronously. For this to work, AnnotatedControllerConfigurer must be configured with an Executor. This would typically by a Callable<java.lang.Integer>
- A CompletableFuture<?>, for instance CompletableFuture<java.lang.Integer>. This allows to use graphql-java java-dataloader to highly optimize the number of requests to the server. The principle is this one: The data loader collects all the data to load, avoid to load several times the same data, and allows parallel execution of the queries, if multiple queries are to be run.
- A Publisher (instead of a Flux), for Subscription for instance
- Specified by:
nbBoards
in interfaceDataFetchersDelegateQuery
- Parameters:
dataFetchingEnvironment
- The GraphQLDataFetchingEnvironment
. It gives you access to the full GraphQL context for this DataFetcher
-
topics
public List<Topic> topics(graphql.schema.DataFetchingEnvironment dataFetchingEnvironment, String boardName) Description copied from interface:DataFetchersDelegateQuery
This method loads the data for Query.topics. It may return whatever is accepted by the Spring Controller, that is:- A resolved value of any type (typically, a List<org.forum.server.graphql.Topic>)
- Mono and Flux for asynchronous value(s). Supported for controller methods and for any DataFetcher as described in Reactive DataFetcher. This would typically be a Mono<List<org.forum.server.graphql.Topic>> or a Flux<List<org.forum.server.graphql.Topic>>
- Kotlin coroutine and Flow are adapted to Mono and Flux
- java.util.concurrent.Callable to have the value(s) produced asynchronously. For this to work, AnnotatedControllerConfigurer must be configured with an Executor. This would typically by a Callable<List<org.forum.server.graphql.Topic>>
- A CompletableFuture<?>, for instance CompletableFuture<List<org.forum.server.graphql.Topic>>. This allows to use graphql-java java-dataloader to highly optimize the number of requests to the server. The principle is this one: The data loader collects all the data to load, avoid to load several times the same data, and allows parallel execution of the queries, if multiple queries are to be run.
- A Publisher (instead of a Flux), for Subscription for instance
- Specified by:
topics
in interfaceDataFetchersDelegateQuery
- Parameters:
dataFetchingEnvironment
- The GraphQLDataFetchingEnvironment
. It gives you access to the full GraphQL context for this DataFetcherboardName
- The input parameter sent in the query by the GraphQL consumer, as defined in the GraphQL schema.
-
findTopics
public List<Topic> findTopics(graphql.schema.DataFetchingEnvironment dataFetchingEnvironment, String boardName, List<String> keyword) Description copied from interface:DataFetchersDelegateQuery
This method loads the data for Query.findTopics. It may return whatever is accepted by the Spring Controller, that is:- A resolved value of any type (typically, a List<org.forum.server.graphql.Topic>)
- Mono and Flux for asynchronous value(s). Supported for controller methods and for any DataFetcher as described in Reactive DataFetcher. This would typically be a Mono<List<org.forum.server.graphql.Topic>> or a Flux<List<org.forum.server.graphql.Topic>>
- Kotlin coroutine and Flow are adapted to Mono and Flux
- java.util.concurrent.Callable to have the value(s) produced asynchronously. For this to work, AnnotatedControllerConfigurer must be configured with an Executor. This would typically by a Callable<List<org.forum.server.graphql.Topic>>
- A CompletableFuture<?>, for instance CompletableFuture<List<org.forum.server.graphql.Topic>>. This allows to use graphql-java java-dataloader to highly optimize the number of requests to the server. The principle is this one: The data loader collects all the data to load, avoid to load several times the same data, and allows parallel execution of the queries, if multiple queries are to be run.
- A Publisher (instead of a Flux), for Subscription for instance
- Specified by:
findTopics
in interfaceDataFetchersDelegateQuery
- Parameters:
dataFetchingEnvironment
- The GraphQLDataFetchingEnvironment
. It gives you access to the full GraphQL context for this DataFetcherboardName
- The input parameter sent in the query by the GraphQL consumer, as defined in the GraphQL schema.keyword
- The input parameter sent in the query by the GraphQL consumer, as defined in the GraphQL schema.
-