Package graphql
Interface GraphQLError
-
- All Superinterfaces:
java.io.Serializable
- All Known Implementing Classes:
AbortExecutionException
,CoercingParseLiteralException
,CoercingParseValueException
,CoercingSerializeException
,DirectiveIllegalArgumentTypeError
,DirectiveIllegalLocationError
,DirectiveIllegalReferenceError
,DirectiveMissingNonNullArgumentError
,DirectiveRedefinitionError
,DirectiveUndeclaredError
,DirectiveUnknownArgumentError
,ExceptionWhileDataFetching
,GoodFaithIntrospection.BadFaithIntrospectionError
,GraphqlErrorException
,IllegalNameError
,InputMapDefinesTooManyFieldsException
,InterfaceFieldArgumentNotOptionalError
,InterfaceFieldArgumentRedefinitionError
,InterfaceFieldRedefinitionError
,InterfaceImplementedMoreThanOnceError
,InterfaceImplementingItselfError
,InterfaceWithCircularImplementationHierarchyError
,IntrospectionDisabledError
,InvalidCursorException
,InvalidPageSizeException
,InvalidSyntaxError
,MissingInterfaceFieldArgumentsError
,MissingInterfaceFieldError
,MissingInterfaceTypeError
,MissingRootTypeException
,MissingScalarImplementationError
,MissingTransitiveInterfaceError
,MissingTypeError
,MissingTypeResolverError
,NonNullableFieldWasNullError
,NonNullableValueCoercedAsNullException
,NonSDLDefinitionError
,NonUniqueArgumentError
,NonUniqueDirectiveError
,NonUniqueNameError
,NotAnInputTypeError
,NotAnOutputTypeError
,OneOfNullValueException
,OneOfTooManyKeysException
,OperationRedefinitionError
,OperationTypesMustBeObjects
,QueryOperationMissingError
,SchemaMissingError
,SchemaRedefinitionError
,SerializationError
,TypeExtensionDirectiveRedefinitionError
,TypeExtensionEnumValueRedefinitionError
,TypeExtensionFieldRedefinitionError
,TypeExtensionMissingBaseTypeError
,TypeMismatchError
,TypeRedefinitionError
,UnionTypeError
,UnknownOperationException
,UnresolvedTypeError
,ValidationError
@PublicApi public interface GraphQLError extends java.io.Serializable
The interface describing graphql errors NOTE: This class implementsSerializable
and hence it can be serialised and placed into a distributed cache. However we are not aiming to provide long term compatibility and do not intend for you to place this serialised data into permanent storage, with times frames that cross graphql-java versions. While we don't change things unnecessarily, we may inadvertently break the serialised compatibility across versions.- See Also:
- GraphQL Spec - 7.1.2 Errors
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
GraphQLError.Builder<B extends GraphQLError.Builder<B>>
A builder ofGraphQLError
s
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description ErrorClassification
getErrorType()
default java.util.Map<java.lang.String,java.lang.Object>
getExtensions()
java.util.List<SourceLocation>
getLocations()
java.lang.String
getMessage()
default java.util.List<java.lang.Object>
getPath()
The graphql spec says that the (optional) path field of any error must be a list of path entries starting at the root of the response and ending with the field associated with the error https://spec.graphql.org/draft/#sec-Errors.Error-Result-Formatstatic GraphQLError.Builder<?>
newError()
default java.util.Map<java.lang.String,java.lang.Object>
toSpecification()
The graphql specification says that result of a call should be a map that follows certain rules on what items should be present.
-
-
-
Method Detail
-
getMessage
java.lang.String getMessage()
- Returns:
- a description of the error intended for the developer as a guide to understand and correct the error
-
getLocations
java.util.List<SourceLocation> getLocations()
- Returns:
- the location(s) within the GraphQL document at which the error occurred. Each
SourceLocation
describes the beginning of an associated syntax element
-
getErrorType
ErrorClassification getErrorType()
- Returns:
- an object classifying this error
-
getPath
default java.util.List<java.lang.Object> getPath()
The graphql spec says that the (optional) path field of any error must be a list of path entries starting at the root of the response and ending with the field associated with the error https://spec.graphql.org/draft/#sec-Errors.Error-Result-Format- Returns:
- the path in list format
-
toSpecification
default java.util.Map<java.lang.String,java.lang.Object> toSpecification()
The graphql specification says that result of a call should be a map that follows certain rules on what items should be present. Certain JSON serializers may or may interpret the error to spec, so this method is provided to produce a map that strictly follows the specification. See : GraphQL Spec - 7.1.2 Errors- Returns:
- a map of the error that strictly follows the specification
-
getExtensions
default java.util.Map<java.lang.String,java.lang.Object> getExtensions()
- Returns:
- a map of error extensions or null if there are none
-
newError
static GraphQLError.Builder<?> newError()
- Returns:
- a new builder of
GraphQLError
s
-
-