HTTPResponse


CLASS

HTTPResponse

Swift
1public class HTTPResponse<Operation: GraphQLOperation>

Data about a response received by an HTTP request.

Properties

httpResponse

Swift
1public var httpResponse: HTTPURLResponse

The HTTPURLResponse received from the URL loading system

rawData

Swift
1public var rawData: Data

The raw data received from the URL loading system

parsedResponse

Swift
1public 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

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

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

Methods

init(response:rawData:parsedResponse:)

Swift
1public init(response: HTTPURLResponse,
2            rawData: Data,
3            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.
Feedback

Edit on GitHub

Forums