Interface GraphQLError
Contains an error message, the location of the code that caused the error, and other information to help you correct the error.
Example to create an instance using the builder pattern
GraphQLError graphQLError = GraphQLError.builder()
.message("{message}")
.plusLocations(locationsBuilder -> locationsBuilder)
.extensions(extensionsBuilder -> extensionsBuilder)
.build()
-
Method Summary
Modifier and TypeMethodDescriptionstatic GraphQLErrorBuilderbuilder()builder factory method for GraphQLErrorstatic GraphQLErrorBuilderbuilder(GraphQLError template) create builder for GraphQLError instancecopyDeep()static GraphQLErrordeepCopy(GraphQLError template) factory method to create a deep copy of GraphQLError@NotNull @Valid GraphQLErrorObjectDictionary with additional information where applicable.@NotNull @Valid List<GraphQLErrorLocation>Location within your query where the error occurred.@NotNull StringDetailed description of the error explaining the root cause of the problem and suggesting how to correct the error.getPath()Query fields listed in order from the root of the query response up to the field in which the error occurred.static GraphQLErrorof()factory methodstatic GraphQLErrorof(GraphQLError template) factory method to create a shallow copy GraphQLErrorvoidsetExtensions(GraphQLErrorObject extensions) Dictionary with additional information where applicable.voidsetLocations(GraphQLErrorLocation... locations) Location within your query where the error occurred.voidsetLocations(List<GraphQLErrorLocation> locations) Location within your query where the error occurred.voidsetMessage(String message) Detailed description of the error explaining the root cause of the problem and suggesting how to correct the error.voidQuery fields listed in order from the root of the query response up to the field in which the error occurred.voidQuery fields listed in order from the root of the query response up to the field in which the error occurred.static com.fasterxml.jackson.core.type.TypeReference<GraphQLError>gives a TypeReference for usage with Jackson DataBinddefault <T> TwithGraphQLError(Function<GraphQLError, T> helper) accessor map function
-
Method Details
-
getMessage
Detailed description of the error explaining the root cause of the problem and suggesting how to correct the error.
- Returns:
- message
-
getLocations
Location within your query where the error occurred.
- Returns:
- locations
-
getPath
Query fields listed in order from the root of the query response up to the field in which the error occurred.
pathis displayed in the response only if an error is associated with a particular field in the query result.- Returns:
- path
-
getExtensions
Dictionary with additional information where applicable.
- Returns:
- extensions
-
setMessage
Detailed description of the error explaining the root cause of the problem and suggesting how to correct the error.
- Parameters:
message- value to be set
-
setLocations
Location within your query where the error occurred.
- Parameters:
locations- values to be set
-
setLocations
Location within your query where the error occurred.
- Parameters:
locations- values to be set
-
setPath
Query fields listed in order from the root of the query response up to the field in which the error occurred.
pathis displayed in the response only if an error is associated with a particular field in the query result.- Parameters:
path- values to be set
-
setPath
Query fields listed in order from the root of the query response up to the field in which the error occurred.
pathis displayed in the response only if an error is associated with a particular field in the query result.- Parameters:
path- values to be set
-
setExtensions
Dictionary with additional information where applicable.
- Parameters:
extensions- value to be set
-
of
factory method- Returns:
- instance of GraphQLError
-
of
factory method to create a shallow copy GraphQLError- Parameters:
template- instance to be copied- Returns:
- copy instance
-
copyDeep
GraphQLError copyDeep() -
deepCopy
factory method to create a deep copy of GraphQLError- Parameters:
template- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for GraphQLError- Returns:
- builder
-
builder
create builder for GraphQLError instance- Parameters:
template- instance with prefilled values for the builder- Returns:
- builder
-
withGraphQLError
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
-