Class QueryByExampleDataFetcher.ReactiveBuilder<T,R>
java.lang.Object
org.springframework.graphql.data.query.QueryByExampleDataFetcher.ReactiveBuilder<T,R>
- Type Parameters:
T- domain typeR- result type
- Enclosing class:
- QueryByExampleDataFetcher<T>
Builder for a reactive Query by Example-based
DataFetcher.
Note that builder instances are immutable and return a new instance of
the builder when calling configuration methods.-
Method Summary
Modifier and TypeMethodDescriptioncursorStrategy(CursorStrategy<org.springframework.data.domain.ScrollPosition> cursorStrategy) Configure strategy for decoding a cursor from a paginated request.defaultScrollSubrange(ScrollSubrange defaultSubrange) Configure aScrollSubrangeto use when a paginated request does not specify a cursor and/or a count of items.DataFetcher<reactor.core.publisher.Flux<R>>many()Build aDataFetcherto fetch many object instances.Project results returned from theReactiveQueryByExampleExecutorinto the targetprojectionType.DataFetcher<reactor.core.publisher.Mono<Iterable<R>>>Build aDataFetcherthat scrolls and returnsWindow.DataFetcher<reactor.core.publisher.Mono<R>>single()Build aDataFetcherto fetch single object instances.sortBy(org.springframework.data.domain.Sort sort) Apply aSortorder.
-
Method Details
-
projectAs
Project results returned from theReactiveQueryByExampleExecutorinto the targetprojectionType. Projection types can be either interfaces with property getters to expose or regular classes outside the entity type hierarchy for DTO projections.- Parameters:
projectionType- projection type- Returns:
- a new
QueryByExampleDataFetcher.ReactiveBuilderinstance with all previously configured options andprojectionTypeapplied
-
cursorStrategy
public QueryByExampleDataFetcher.ReactiveBuilder<T,R> cursorStrategy(@Nullable CursorStrategy<org.springframework.data.domain.ScrollPosition> cursorStrategy) Configure strategy for decoding a cursor from a paginated request.By default, this is
ScrollPositionCursorStrategywithCursorEncoder.base64()encoding.- Parameters:
cursorStrategy- the strategy to use- Returns:
- a new
QueryByExampleDataFetcher.Builderinstance with all previously configured options andSortapplied - Since:
- 1.2.0
-
defaultScrollSubrange
public QueryByExampleDataFetcher.ReactiveBuilder<T,R> defaultScrollSubrange(@Nullable ScrollSubrange defaultSubrange) Configure aScrollSubrangeto use when a paginated request does not specify a cursor and/or a count of items.By default, this is
OffsetScrollPosition.initial()with a count of 20.- Returns:
- a new
QueryByExampleDataFetcher.Builderinstance with all previously configured options andSortapplied - Since:
- 1.2.0
-
sortBy
public QueryByExampleDataFetcher.ReactiveBuilder<T,R> sortBy(org.springframework.data.domain.Sort sort) Apply aSortorder.- Parameters:
sort- the default sort order- Returns:
- a new
QueryByExampleDataFetcher.ReactiveBuilderinstance with all previously configured options andSortapplied
-
single
Build aDataFetcherto fetch single object instances. -
many
Build aDataFetcherto fetch many object instances. -
scrollable
Build aDataFetcherthat scrolls and returnsWindow.- Since:
- 1.2.0
-