Interface HttpSyncGraphQlClient.Builder<B extends HttpSyncGraphQlClient.Builder<B>>
- Type Parameters:
B
- the type of builder
- All Superinterfaces:
GraphQlClient.BaseBuilder<B>
,GraphQlClient.SyncBuilder<B>
- Enclosing interface:
HttpSyncGraphQlClient
public static interface HttpSyncGraphQlClient.Builder<B extends HttpSyncGraphQlClient.Builder<B>>
extends GraphQlClient.SyncBuilder<B>
Builder for the GraphQL over HTTP client with a blocking execution chain.
- Since:
- 1.3.0
- Author:
- Rossen Stoyanchev
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Build theHttpSyncGraphQlClient
instance.Configure message converters for JSON for use in theGraphQlResponse
to convert response data to higher level objects.Add the given header to HTTP requests.headers
(Consumer<HttpHeaders> headersConsumer) Variant ofheader(String, String...)
that provides access to the underlying headers to inspect or modify directly.messageConverters
(Consumer<List<HttpMessageConverter<?>>> configurer) Deprecated, for removal: This API element is subject to removal in a future version.restClient
(Consumer<RestClient.Builder> builderConsumer) Customize the underlyingRestClient
.Set the GraphQL endpoint URL as a String.Set the GraphQL endpoint URL.Methods inherited from interface org.springframework.graphql.client.GraphQlClient.BaseBuilder
blockingTimeout, documentSource
Methods inherited from interface org.springframework.graphql.client.GraphQlClient.SyncBuilder
interceptor, interceptors, scheduler
-
Method Details
-
url
-
url
-
header
-
headers
Variant ofheader(String, String...)
that provides access to the underlying headers to inspect or modify directly.- Parameters:
headersConsumer
- a function that consumes theHttpHeaders
-
messageConverters
@Deprecated(since="2.0.0", forRemoval=true) B messageConverters(Consumer<List<HttpMessageConverter<?>>> configurer) Deprecated, for removal: This API element is subject to removal in a future version.since 2.0 in favor ofconfigureMessageConverters(Consumer)
.Configure message converters for JSON for use in theGraphQlResponse
to convert response data to higher level objects.- Parameters:
configurer
- the configurer to apply- Returns:
- this builder
-
configureMessageConverters
Configure message converters for JSON for use in theGraphQlResponse
to convert response data to higher level objects.- Parameters:
configurer
- the configurer to apply- Returns:
- this builder
-
restClient
Customize the underlyingRestClient
.Note that some properties of
RestClient.Builder
like the base URL, headers, and message converters can be customized through this builder.- Parameters:
builderConsumer
- a consumer that customizes theRestClient
.- See Also:
-
build
HttpSyncGraphQlClient build()Build theHttpSyncGraphQlClient
instance.- Specified by:
build
in interfaceGraphQlClient.BaseBuilder<B extends HttpSyncGraphQlClient.Builder<B>>
-
configureMessageConverters(Consumer)
.