Interface GraphQLResponse
public interface GraphQLResponse
error is present in the response only if the GraphQL query was unsuccessful.
Example to create an instance using the builder pattern
GraphQLResponse graphQLResponse = GraphQLResponse.builder()
.build()
-
Method Summary
Modifier and TypeMethodDescriptionstatic GraphQLResponseBuilderbuilder()builder factory method for GraphQLResponsestatic GraphQLResponseBuilderbuilder(GraphQLResponse template) create builder for GraphQLResponse instancecopyDeep()static GraphQLResponsedeepCopy(GraphQLResponse template) factory method to create a deep copy of GraphQLResponsegetData()JSON object that contains the results of a GraphQL query.@Valid List<GraphQLError>Errors that the GraphQL query returns.static GraphQLResponseof()factory methodstatic GraphQLResponseof(GraphQLResponse template) factory method to create a shallow copy GraphQLResponsevoidJSON object that contains the results of a GraphQL query.voidsetErrors(GraphQLError... errors) Errors that the GraphQL query returns.voidsetErrors(List<GraphQLError> errors) Errors that the GraphQL query returns.static com.fasterxml.jackson.core.type.TypeReference<GraphQLResponse>gives a TypeReference for usage with Jackson DataBinddefault <T> TwithGraphQLResponse(Function<GraphQLResponse, T> helper) accessor map function
-
Method Details
-
getData
Object getData()JSON object that contains the results of a GraphQL query.
- Returns:
- data
-
getErrors
Errors that the GraphQL query returns.
- Returns:
- errors
-
setData
JSON object that contains the results of a GraphQL query.
- Parameters:
data- value to be set
-
setErrors
Errors that the GraphQL query returns.
- Parameters:
errors- values to be set
-
setErrors
Errors that the GraphQL query returns.
- Parameters:
errors- values to be set
-
of
factory method- Returns:
- instance of GraphQLResponse
-
of
factory method to create a shallow copy GraphQLResponse- Parameters:
template- instance to be copied- Returns:
- copy instance
-
copyDeep
GraphQLResponse copyDeep() -
deepCopy
factory method to create a deep copy of GraphQLResponse- Parameters:
template- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for GraphQLResponse- Returns:
- builder
-
builder
create builder for GraphQLResponse instance- Parameters:
template- instance with prefilled values for the builder- Returns:
- builder
-
withGraphQLResponse
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
-