Interface GraphQLError
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
AbortExecutionException, BaseError, CoercingParseLiteralException, CoercingParseValueException, CoercingSerializeException, DirectiveIllegalArgumentTypeError, DirectiveIllegalLocationError, DirectiveIllegalReferenceError, DirectiveMissingNonNullArgumentError, DirectiveRedefinitionError, DirectiveUndeclaredError, DirectiveUnknownArgumentError, ExceptionWhileDataFetching, FieldValidationSupport.FieldAndArgError, GoodFaithIntrospection.BadFaithIntrospectionError, GraphqlErrorBuilder.GraphqlErrorImpl, 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
The interface describing graphql errors
NOTE: This class implements
Serializable 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:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceGraphQLError.Builder<B extends GraphQLError.Builder<B>>A builder ofGraphQLErrors -
Method Summary
Modifier and TypeMethodDescriptiongetPath()The graphql spec says that the (optional) path field of any error should be a list of path entries https://spec.graphql.org/October2021/#sec-Handling-Field-Errorsstatic GraphQLError.Builder<?> newError()The graphql specification says that result of a call should be a map that follows certain rules on what items should be present.
-
Method Details
-
getMessage
String getMessage()- Returns:
- a description of the error intended for the developer as a guide to understand and correct the error
-
getLocations
List<SourceLocation> getLocations()- Returns:
- the location(s) within the GraphQL document at which the error occurred. Each
SourceLocationdescribes the beginning of an associated syntax element
-
getErrorType
ErrorClassification getErrorType()- Returns:
- an object classifying this error
-
getPath
-
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
-
newError
- Returns:
- a new builder of
GraphQLErrors
-