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 GraphQLErrorBuilder
builder()
builder factory method for GraphQLErrorstatic GraphQLErrorBuilder
builder
(GraphQLError template) create builder for GraphQLError instancestatic GraphQLError
deepCopy
(GraphQLError template) factory method to create a deep copy of GraphQLError@NotNull @Valid GraphQLErrorObject
Dictionary with additional information where applicable.@NotNull @Valid List<GraphQLErrorLocation>
Location within your query where the error occurred.@NotNull String
Detailed 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 GraphQLError
of()
factory methodstatic GraphQLError
of
(GraphQLError template) factory method to create a shallow copy GraphQLErrorvoid
setExtensions
(GraphQLErrorObject extensions) Dictionary with additional information where applicable.void
setLocations
(GraphQLErrorLocation... locations) Location within your query where the error occurred.void
setLocations
(List<GraphQLErrorLocation> locations) Location within your query where the error occurred.void
setMessage
(String message) Detailed description of the error explaining the root cause of the problem and suggesting how to correct the error.void
Query fields listed in order from the root of the query response up to the field in which the error occurred.void
Query 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> T
withGraphQLError
(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.
path
is 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.
path
is 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.
path
is 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
-
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
-