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.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Build theHttpSyncGraphQlClient
instance.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) Configure message converters for JSON for use in theGraphQlResponse
to convert response data to higher level objects.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
Set the GraphQL endpoint URL as a String.- Parameters:
url
- the url to send HTTP requests to
-
url
Set the GraphQL endpoint URL.- Parameters:
url
- the url to send HTTP requests to
-
header
Add the given header to HTTP requests.- Parameters:
name
- the header namevalues
- the header values
-
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
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>>
-