public interface VertxDataFetcher<T> extends graphql.schema.DataFetcher<CompletionStage<T>>
DataFetcher
that works well with Vert.x callback and Future
based APIs.Modifier and Type | Method and Description |
---|---|
static <T> VertxDataFetcher<T> |
create(java.util.function.BiConsumer<graphql.schema.DataFetchingEnvironment,Promise<T>> dataFetcher)
Create a new data fetcher that works well with callback based APIs.
|
static <T> VertxDataFetcher<T> |
create(java.util.function.BiConsumer<graphql.schema.DataFetchingEnvironment,Promise<T>> dataFetcher,
java.util.function.Function<graphql.schema.DataFetchingEnvironment,Context> contextProvider)
Like
create(BiConsumer) , except the method uses the provided contextProvider instead of capturing the current one. |
static <T> VertxDataFetcher<T> |
create(java.util.function.Function<graphql.schema.DataFetchingEnvironment,Future<T>> dataFetcher)
Create a new data fetcher that works well with
Future based APIs. |
static <T> VertxDataFetcher<T> |
create(java.util.function.Function<graphql.schema.DataFetchingEnvironment,Future<T>> dataFetcher,
java.util.function.Function<graphql.schema.DataFetchingEnvironment,Context> contextProvider)
Like
create(Function) , except the method uses the provided contextProvider instead of capturing the current one. |
static <T> VertxDataFetcher<T> create(java.util.function.BiConsumer<graphql.schema.DataFetchingEnvironment,Promise<T>> dataFetcher)
The provided dataFetcher
will be invoked with the following arguments:
DataFetchingEnvironment
Promise
that the implementor must complete after the data objects are fetchedstatic <T> VertxDataFetcher<T> create(java.util.function.BiConsumer<graphql.schema.DataFetchingEnvironment,Promise<T>> dataFetcher, java.util.function.Function<graphql.schema.DataFetchingEnvironment,Context> contextProvider)
create(BiConsumer)
, except the method uses the provided contextProvider
instead of capturing the current one.static <T> VertxDataFetcher<T> create(java.util.function.Function<graphql.schema.DataFetchingEnvironment,Future<T>> dataFetcher)
Future
based APIs.
The provided dataFetcher
will be invoked with the following argument:
DataFetchingEnvironment
static <T> VertxDataFetcher<T> create(java.util.function.Function<graphql.schema.DataFetchingEnvironment,Future<T>> dataFetcher, java.util.function.Function<graphql.schema.DataFetchingEnvironment,Context> contextProvider)
create(Function)
, except the method uses the provided contextProvider
instead of capturing the current one.Copyright © 2022 Eclipse. All rights reserved.