public static interface GraphQlClient.RequestSpec
Modifier and Type | Method and Description |
---|---|
GraphQlClient.RequestSpec |
attribute(String name,
Object value)
Set a client request attribute.
|
GraphQlClient.RequestSpec |
attributes(Consumer<Map<String,Object>> attributesConsumer)
Manipulate the client request attributes.
|
reactor.core.publisher.Mono<ClientGraphQlResponse> |
execute()
Execute request with a single response, e.g.
|
reactor.core.publisher.Flux<ClientGraphQlResponse> |
executeSubscription()
Execute a "subscription" request and return a stream of responses.
|
GraphQlClient.RequestSpec |
extension(String name,
Object value)
Add a value for a protocol extension.
|
GraphQlClient.RequestSpec |
extensions(Map<String,Object> extensions)
Add all given protocol extensions.
|
GraphQlClient.RequestSpec |
operationName(String operationName)
Set the name of the operation in the
document
to execute, if the document contains multiple operations. |
GraphQlClient.RetrieveSpec |
retrieve(String path)
Shortcut for
execute() with a single field path to decode from. |
GraphQlClient.RetrieveSubscriptionSpec |
retrieveSubscription(String path)
Shortcut for
executeSubscription() with a single field path to decode from. |
GraphQlClient.RequestSpec |
variable(String name,
Object value)
Add a value for a variable defined by the operation.
|
GraphQlClient.RequestSpec |
variables(Map<String,Object> variables)
Add all given values for variables defined by the operation.
|
GraphQlClient.RequestSpec operationName(@Nullable String operationName)
document
to execute, if the document contains multiple operations.operationName
- the operation nameGraphQlClient.RequestSpec variable(String name, @Nullable Object value)
name
- the variable namevalue
- the variable valueGraphQlClient.RequestSpec variables(Map<String,Object> variables)
variables
- the variable valuesGraphQlClient.RequestSpec extension(String name, @Nullable Object value)
name
- the protocol extension namevalue
- the extension valueGraphQlClient.RequestSpec extensions(Map<String,Object> extensions)
extensions
- the protocol extensionsGraphQlClient.RequestSpec attribute(String name, Object value)
This is purely for client side request processing, i.e. available
throughout the GraphQlClientInterceptor
chain but not sent.
name
- the name of the attributevalue
- the attribute valueGraphQlClient.RequestSpec attributes(Consumer<Map<String,Object>> attributesConsumer)
attributesConsumer
- consumer to customize attributes withGraphQlClient.RetrieveSpec retrieve(String path)
execute()
with a single field path to decode from.FieldAccessException
- if the target field has any errors,
including nested errors.GraphQlClient.RetrieveSubscriptionSpec retrieveSubscription(String path)
executeSubscription()
with a single field path to decode from.reactor.core.publisher.Mono<ClientGraphQlResponse> execute()
Mono
with a ClientGraphQlResponse
for further
decoding of the response. The Mono
may end wth an error due
to transport level issues.reactor.core.publisher.Flux<ClientGraphQlResponse> executeSubscription()
Flux
with responses that provide further options for
decoding of each response. The Flux
may terminate as follows:
SubscriptionErrorException
if the subscription ends with an error.
WebSocketDisconnectedException
if the connection is closed or
lost before the stream terminates.
The Flux
may be cancelled to notify the server to end the
subscription stream.