Class GraphQLRequestBuilder
- All Implemented Interfaces:
Builder<GraphQLRequest>
Example to create an instance using the builder pattern
GraphQLRequest graphQLRequest = GraphQLRequest.builder()
.query("{query}")
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
builds GraphQLRequest with checking for non-null required valuesbuilds GraphQLRequest without checking for non-null required valuesName of the operation, if you defined several operations inquery
.getQuery()
String representation of the Source Text of the Document that is specified in the Language section of the GraphQL specification.JSON object that contains key-value pairs in which the keys are variable names and the values are variable values.static GraphQLRequestBuilder
of()
factory method for an instance of GraphQLRequestBuilderstatic GraphQLRequestBuilder
of
(GraphQLRequest template) create builder for GraphQLRequest instanceoperationName
(String operationName) Name of the operation, if you defined several operations inquery
.String representation of the Source Text of the Document that is specified in the Language section of the GraphQL specification.variables
(GraphQLVariablesMap variables) JSON object that contains key-value pairs in which the keys are variable names and the values are variable values.JSON object that contains key-value pairs in which the keys are variable names and the values are variable values.JSON object that contains key-value pairs in which the keys are variable names and the values are variable values.
-
Constructor Details
-
GraphQLRequestBuilder
public GraphQLRequestBuilder()
-
-
Method Details
-
query
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- Returns:
- Builder
-
operationName
Name of the operation, if you defined several operations in
query
.- Parameters:
operationName
- value to be set- Returns:
- Builder
-
variables
public GraphQLRequestBuilder variables(Function<GraphQLVariablesMapBuilder, GraphQLVariablesMapBuilder> builder) JSON object that contains key-value pairs in which the keys are variable names and the values are variable values.
- Parameters:
builder
- function to build the variables value- Returns:
- Builder
-
withVariables
public GraphQLRequestBuilder withVariables(Function<GraphQLVariablesMapBuilder, GraphQLVariablesMap> builder) JSON object that contains key-value pairs in which the keys are variable names and the values are variable values.
- Parameters:
builder
- function to build the variables value- Returns:
- Builder
-
variables
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- Returns:
- Builder
-
getQuery
String representation of the Source Text of the Document that is specified in the Language section of the GraphQL specification.
- Returns:
- query
-
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
-
build
builds GraphQLRequest with checking for non-null required values- Specified by:
build
in interfaceBuilder<GraphQLRequest>
- Returns:
- GraphQLRequest
-
buildUnchecked
builds GraphQLRequest without checking for non-null required values- Returns:
- GraphQLRequest
-
of
factory method for an instance of GraphQLRequestBuilder- Returns:
- builder
-
of
create builder for GraphQLRequest instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-