Class AbstractGraphQlClientSyncBuilder<B extends AbstractGraphQlClientSyncBuilder<B>>
- Type Parameters:
B
- the type of builder
- All Implemented Interfaces:
GraphQlClient.BaseBuilder<B>
,GraphQlClient.SyncBuilder<B>
GraphQlClient.SyncBuilder
implementations.
Subclasses must implement GraphQlClient.BaseBuilder.build()
and call
buildGraphQlClient(SyncGraphQlTransport)
to obtain a default, transport
agnostic GraphQlClient
. A transport specific extension can then wrap
this default tester by extending AbstractDelegatingGraphQlClient
.
- Since:
- 1.3.0
- Author:
- Rossen Stoyanchev
- See Also:
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
Default constructor for use from subclasses. -
Method Summary
Modifier and TypeMethodDescriptionblockingTimeout
(Duration blockingTimeout) Configure a timeout to use for blocking execution.protected GraphQlClient
buildGraphQlClient
(SyncGraphQlTransport transport) Build the default transport-agnostic client that subclasses can then wrap withAbstractDelegatingGraphQlClient
.documentSource
(DocumentSource documentSource) Configure aDocumentSource
strategy to resolve a document by name.protected Consumer<AbstractGraphQlClientSyncBuilder<?>>
Return aConsumer
to initialize new builders from "this" builder.interceptor
(SyncGraphQlClientInterceptor... interceptors) Configure interceptors to be invoked before delegating to theSyncGraphQlTransport
to perform the request.interceptors
(Consumer<List<SyncGraphQlClientInterceptor>> interceptorsConsumer) Customize the list of interceptors.scheduler
(reactor.core.scheduler.Scheduler scheduler) The scheduler to use for non-blocking execution withGraphQlClient.RequestSpec.execute()
andGraphQlClient.RequestSpec.retrieve(String)
.protected void
setJsonConverter
(HttpMessageConverter<Object> converter) Transport-specific subclasses can provide their JSONEncoder
andDecoder
for use at the client level, for mapping response data to some target entity type.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.graphql.client.GraphQlClient.BaseBuilder
build
-
Field Details
-
jackson2Present
protected static final boolean jackson2Present
-
-
Constructor Details
-
AbstractGraphQlClientSyncBuilder
protected AbstractGraphQlClientSyncBuilder()Default constructor for use from subclasses.Subclasses must set the transport to use before
GraphQlClient.BaseBuilder.build()
or during, by overridingGraphQlClient.BaseBuilder.build()
.
-
-
Method Details
-
interceptor
Description copied from interface:GraphQlClient.SyncBuilder
Configure interceptors to be invoked before delegating to theSyncGraphQlTransport
to perform the request.- Specified by:
interceptor
in interfaceGraphQlClient.SyncBuilder<B extends AbstractGraphQlClientSyncBuilder<B>>
- Parameters:
interceptors
- the interceptors to add- Returns:
- this builder
-
interceptors
Description copied from interface:GraphQlClient.SyncBuilder
Customize the list of interceptors. The provided list is "live", so the consumer can inspect and insert interceptors accordingly.- Specified by:
interceptors
in interfaceGraphQlClient.SyncBuilder<B extends AbstractGraphQlClientSyncBuilder<B>>
- Parameters:
interceptorsConsumer
- consumer to customize the interceptors with- Returns:
- this builder
-
documentSource
Description copied from interface:GraphQlClient.BaseBuilder
Configure aDocumentSource
strategy to resolve a document by name. For use withinGraphQlClient.documentName(String)
.By default, this is set to
ResourceDocumentSource
with classpath location"graphql-documents/"
andResourceDocumentSource.FILE_EXTENSIONS
as extensions.- Specified by:
documentSource
in interfaceGraphQlClient.BaseBuilder<B extends AbstractGraphQlClientSyncBuilder<B>>
- Parameters:
documentSource
- the strategy for resolving documents by their names
-
scheduler
Description copied from interface:GraphQlClient.SyncBuilder
The scheduler to use for non-blocking execution withGraphQlClient.RequestSpec.execute()
andGraphQlClient.RequestSpec.retrieve(String)
.By default this is set to
Schedulers.boundedElastic()
.- Specified by:
scheduler
in interfaceGraphQlClient.SyncBuilder<B extends AbstractGraphQlClientSyncBuilder<B>>
- Parameters:
scheduler
- the scheduler
-
blockingTimeout
Description copied from interface:GraphQlClient.BaseBuilder
Configure a timeout to use for blocking execution.By default this is not set, in which case the behavior depends on connection and request timeout settings of the underlying transport. We recommend configuring timeout values directly if possible on the underlying transport library such an HTTP client library as that can provide more control over such settings.
- Specified by:
blockingTimeout
in interfaceGraphQlClient.BaseBuilder<B extends AbstractGraphQlClientSyncBuilder<B>>
- Parameters:
blockingTimeout
- the timeout to use
-
setJsonConverter
Transport-specific subclasses can provide their JSONEncoder
andDecoder
for use at the client level, for mapping response data to some target entity type.- Parameters:
converter
- the message converter for JSON payloads
-
buildGraphQlClient
Build the default transport-agnostic client that subclasses can then wrap withAbstractDelegatingGraphQlClient
.- Parameters:
transport
- the GraphQL transport to be used by the client
-
getBuilderInitializer
Return aConsumer
to initialize new builders from "this" builder.
-