Interface GraphQLRequest
- All Known Subinterfaces:
GraphQLRequest<T>
public interface GraphQLRequest
The query, operation name, and variables that are sent to the GraphQL API.
Example to create an instance using the builder pattern
GraphQLRequest graphQLRequest = GraphQLRequest.builder()
.query("{query}")
.build()
-
Method Summary
Modifier and TypeMethodDescriptionstatic GraphQLRequestBuilder
builder()
builder factory method for GraphQLRequeststatic GraphQLRequestBuilder
builder
(GraphQLRequest template) create builder for GraphQLRequest instancestatic GraphQLRequest
deepCopy
(GraphQLRequest template) factory method to create a deep copy of GraphQLRequestName of the operation, if you defined several operations inquery
.@NotNull String
getQuery()
String representation of the Source Text of the Document that is specified in the Language section of the GraphQL specification.@Valid GraphQLVariablesMap
JSON object that contains key-value pairs in which the keys are variable names and the values are variable values.static GraphQLRequest
of()
factory methodstatic GraphQLRequest
of
(GraphQLRequest template) factory method to create a shallow copy GraphQLRequestvoid
setOperationName
(String operationName) Name of the operation, if you defined several operations inquery
.void
String representation of the Source Text of the Document that is specified in the Language section of the GraphQL specification.void
setVariables
(GraphQLVariablesMap variables) JSON object that contains key-value pairs in which the keys are variable names and the values are variable values.static com.fasterxml.jackson.core.type.TypeReference<GraphQLRequest>
gives a TypeReference for usage with Jackson DataBinddefault <T> T
withGraphQLRequest
(Function<GraphQLRequest, T> helper) accessor map function
-
Method Details
-
getQuery
String representation of the Source Text of the Document that is specified in the Language section of the GraphQL specification.
- Returns:
- query
-
getOperationName
String getOperationName()Name of the operation, if you defined several operations in
query
.- Returns:
- operationName
-
getVariables
JSON object that contains key-value pairs in which the keys are variable names and the values are variable values.
- Returns:
- variables
-
setQuery
String representation of the Source Text of the Document that is specified in the Language section of the GraphQL specification.
- Parameters:
query
- value to be set
-
setOperationName
Name of the operation, if you defined several operations in
query
.- Parameters:
operationName
- value to be set
-
setVariables
JSON object that contains key-value pairs in which the keys are variable names and the values are variable values.
- Parameters:
variables
- value to be set
-
of
factory method- Returns:
- instance of GraphQLRequest
-
of
factory method to create a shallow copy GraphQLRequest- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
deepCopy
factory method to create a deep copy of GraphQLRequest- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for GraphQLRequest- Returns:
- builder
-
builder
create builder for GraphQLRequest instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-
withGraphQLRequest
accessor map function- Type Parameters:
T
- mapped type- Parameters:
helper
- function to map the object- Returns:
- mapped value
-
typeReference
gives a TypeReference for usage with Jackson DataBind- Returns:
- TypeReference
-