/
Launch Apollo Studio


CLASS

HTTPResponse

public class HTTPResponse<Operation: GraphQLOperation>

Data about a response received by an HTTP request.

Properties

httpResponse

public var httpResponse: HTTPURLResponse

The HTTPURLResponse received from the URL loading system

rawData

public var rawData: Data

The raw data received from the URL loading system

parsedResponse

public var parsedResponse: GraphQLResult<Operation.Data>?

[optional] The data as parsed into a GraphQLResult, which can eventually be returned to the UI. Will be nil if not yet parsed.

legacyResponse

public var legacyResponse: GraphQLResponse<Operation.Data>? = nil

[optional] The data as parsed into a GraphQLResponse for legacy caching purposes. If you're not using the LegacyParsingInterceptor, you probably shouldn't be using this property. NOTE: This property will be removed when the transition to a Codable-based Codegen is complete.

Methods

init(response:rawData:parsedResponse:)

public init(response: HTTPURLResponse,
            rawData: Data,
            parsedResponse: GraphQLResult<Operation.Data>?)

Designated initializer

  • Parameters:

    • response: The HTTPURLResponse received from the server.
    • rawData: The raw, unparsed data received from the server.
    • parsedResponse: [optional] The response parsed into the ParsedValue type. Will be nil if not yet parsed, or if parsing failed.

Parameters

NameDescription
responseThe HTTPURLResponse received from the server.
rawDataThe raw, unparsed data received from the server.
parsedResponse[optional] The response parsed into the ParsedValue type. Will be nil if not yet parsed, or if parsing failed.
Edit on GitHub