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 Details

    • DataFetchersDelegateQueryImpl

      public DataFetchersDelegateQueryImpl()
  • Method Details

    • boards

      public List<Board> boards(graphql.schema.DataFetchingEnvironment dataFetchingEnvironment)
      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>>
      As a complement to the spring-graphql documentation, you may also return:
      • 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 interface DataFetchersDelegateQuery
      Parameters:
      dataFetchingEnvironment - The GraphQL DataFetchingEnvironment. It gives you access to the full GraphQL context for this DataFetcher
    • nbBoards

      public Integer nbBoards(graphql.schema.DataFetchingEnvironment dataFetchingEnvironment)
      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>
      As a complement to the spring-graphql documentation, you may also return:
      • 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 interface DataFetchersDelegateQuery
      Parameters:
      dataFetchingEnvironment - The GraphQL DataFetchingEnvironment. 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>>
      As a complement to the spring-graphql documentation, you may also return:
      • 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 interface DataFetchersDelegateQuery
      Parameters:
      dataFetchingEnvironment - The GraphQL DataFetchingEnvironment. It gives you access to the full GraphQL context for this DataFetcher
      boardName - 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>>
      As a complement to the spring-graphql documentation, you may also return:
      • 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 interface DataFetchersDelegateQuery
      Parameters:
      dataFetchingEnvironment - The GraphQL DataFetchingEnvironment. It gives you access to the full GraphQL context for this DataFetcher
      boardName - 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.