GraphQLResponseError

public enum GraphQLResponseError<ResponseType> : AmplifyError where ResponseType : Decodable, ResponseType : Sendable

An error response from a GraphQL API

  • An error response. The associated value will be an array of GraphQLError objects that contain service-specific error messages. https://graphql.github.io/graphql-spec/June2018/#sec-Errors

    Declaration

    Swift

    case error([GraphQLError])
  • A partially-successful response. The ResponseType associated value will contain as much of the payload as the service was able to fulfill, and the errors will be an array of GraphQLError that contain service-specific error messages.

    Note

    A mutation on a model with a relationship commonly lands here: the service redacts the related object, returning it as null, when it cannot determine that the related model shares the parent’s authorization rules. The record itself is written and fully decoded, so the associated value is usable and the relationship can be loaded with a separate query.

    Declaration

    Swift

    case partial(ResponseType, [GraphQLError])
  • A successful, or partially-successful response from the server that could not be transformed into the specified response type. The RawGraphQLResponse contains the entire response from the service, including data and errors.

    Declaration

    Swift

    case transformationError(RawGraphQLResponse, APIError)
  • An unknown error occurred

    Declaration

    Swift

    case unknown(ErrorDescription, RecoverySuggestion, Error?)
  • Declaration

    Swift

    public var errorDescription: ErrorDescription { get }
  • Declaration

    Swift

    public var recoverySuggestion: RecoverySuggestion { get }
  • Declaration

    Swift

    public var underlyingError: Error? { get }
  • Declaration

    Swift

    public init(
        errorDescription: ErrorDescription = "An unknown error occurred",
        recoverySuggestion: RecoverySuggestion = "See `underlyingError` for more details",
        error: Error
    )