Class GraphQLErrorBuilder
- All Implemented Interfaces:
Builder<GraphQLError>
Example to create an instance using the builder pattern
GraphQLError graphQLError = GraphQLError.builder()
.message("{message}")
.plusLocations(locationsBuilder -> locationsBuilder)
.extensions(extensionsBuilder -> extensionsBuilder)
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionLocation within your query where the error occurred.build()
builds GraphQLError with checking for non-null required valuesbuilds GraphQLError without checking for non-null required valuesextensions
(GraphQLErrorObject extensions) Dictionary with additional information where applicable.extensions
(Function<GraphQLErrorObjectBuilder, Builder<? extends GraphQLErrorObject>> builder) Dictionary with additional information where applicable.Dictionary with additional information where applicable.Location within your query where the error occurred.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.locations
(GraphQLErrorLocation... locations) Location within your query where the error occurred.locations
(List<GraphQLErrorLocation> locations) Location within your query where the error occurred.Detailed description of the error explaining the root cause of the problem and suggesting how to correct the error.static GraphQLErrorBuilder
of()
factory method for an instance of GraphQLErrorBuilderstatic GraphQLErrorBuilder
of
(GraphQLError template) create builder for GraphQLError instanceQuery fields listed in order from the root of the query response up to the field in which the error occurred.Query fields listed in order from the root of the query response up to the field in which the error occurred.plusLocations
(GraphQLErrorLocation... locations) Location within your query where the error occurred.Location within your query where the error occurred.Query fields listed in order from the root of the query response up to the field in which the error occurred.Location within your query where the error occurred.Location within your query where the error occurred.
-
Constructor Details
-
GraphQLErrorBuilder
public GraphQLErrorBuilder()
-
-
Method Details
-
message
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- Returns:
- Builder
-
locations
Location within your query where the error occurred.
- Parameters:
locations
- value to be set- Returns:
- Builder
-
locations
Location within your query where the error occurred.
- Parameters:
locations
- value to be set- Returns:
- Builder
-
plusLocations
Location within your query where the error occurred.
- Parameters:
locations
- value to be set- Returns:
- Builder
-
plusLocations
public GraphQLErrorBuilder plusLocations(Function<GraphQLErrorLocationBuilder, GraphQLErrorLocationBuilder> builder) Location within your query where the error occurred.
- Parameters:
builder
- function to build the locations value- Returns:
- Builder
-
withLocations
public GraphQLErrorBuilder withLocations(Function<GraphQLErrorLocationBuilder, GraphQLErrorLocationBuilder> builder) Location within your query where the error occurred.
- Parameters:
builder
- function to build the locations value- Returns:
- Builder
-
addLocations
public GraphQLErrorBuilder addLocations(Function<GraphQLErrorLocationBuilder, GraphQLErrorLocation> builder) Location within your query where the error occurred.
- Parameters:
builder
- function to build the locations value- Returns:
- Builder
-
setLocations
public GraphQLErrorBuilder setLocations(Function<GraphQLErrorLocationBuilder, GraphQLErrorLocation> builder) Location within your query where the error occurred.
- Parameters:
builder
- function to build the locations value- Returns:
- Builder
-
path
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
- value to be set- Returns:
- Builder
-
path
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
- value to be set- Returns:
- Builder
-
plusPath
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
- value to be set- Returns:
- Builder
-
extensions
Dictionary with additional information where applicable.
- Parameters:
extensions
- value to be set- Returns:
- Builder
-
extensions
public GraphQLErrorBuilder extensions(Function<GraphQLErrorObjectBuilder, Builder<? extends GraphQLErrorObject>> builder) Dictionary with additional information where applicable.
- Parameters:
builder
- function to build the extensions value- Returns:
- Builder
-
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
-
build
builds GraphQLError with checking for non-null required values- Specified by:
build
in interfaceBuilder<GraphQLError>
- Returns:
- GraphQLError
-
buildUnchecked
builds GraphQLError without checking for non-null required values- Returns:
- GraphQLError
-
of
factory method for an instance of GraphQLErrorBuilder- Returns:
- builder
-
of
create builder for GraphQLError instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-