Docs
Launch GraphOS Studio
You're viewing documentation for a previous version of this software. Switch to the latest stable version.


STRUCT

JSONResponseParsingInterceptor

public struct JSONResponseParsingInterceptor: ApolloInterceptor

An interceptor which parses JSON response data into a GraphQLResult and attaches it to the HTTPResponse.

Properties

cacheKeyForObject

public let cacheKeyForObject: CacheKeyForObject?

Methods

init(cacheKeyForObject:)

public init(cacheKeyForObject: CacheKeyForObject? = nil)

Designated Initializer

interceptAsync(chain:request:response:completion:)

public func interceptAsync<Operation: GraphQLOperation>(
chain: RequestChain,
request: HTTPRequest<Operation>,
response: HTTPResponse<Operation>?,
completion: @escaping (Result<GraphQLResult<Operation.Data>, Error>) -> Void
)

Parameters

NameDescription
chainThe chain the interceptor is a part of.
requestThe request, as far as it has been constructed
response[optional] The response, if received
completionThe completion block to fire when data needs to be returned to the UI.
Next
Introduction
Edit on GitHubEditForumsDiscord

© 2024 Apollo Graph Inc.

Privacy Policy

Company