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 GraphQLRequestBuilderbuilder()builder factory method for GraphQLRequeststatic GraphQLRequestBuilderbuilder(GraphQLRequest template) create builder for GraphQLRequest instancecopyDeep()static GraphQLRequestdeepCopy(GraphQLRequest template) factory method to create a deep copy of GraphQLRequestName of the operation, if you defined several operations inquery.@NotNull StringgetQuery()String representation of the Source Text of the Document that is specified in the Language section of the GraphQL specification.@Valid GraphQLVariablesMapJSON object that contains key-value pairs in which the keys are variable names and the values are variable values.static GraphQLRequestof()factory methodstatic GraphQLRequestof(GraphQLRequest template) factory method to create a shallow copy GraphQLRequestvoidsetOperationName(String operationName) Name of the operation, if you defined several operations inquery.voidString representation of the Source Text of the Document that is specified in the Language section of the GraphQL specification.voidsetVariables(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> TwithGraphQLRequest(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
-
copyDeep
GraphQLRequest copyDeep() -
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
-