Wednesday, September 30, 2026
HomeiOS Developmentios - Apollo GraphQL responce physique

ios – Apollo GraphQL responce physique

[ad_1]

I am utilizing Apollo GraphQL for API response. Added ApolloInterceptor. The issue is that response is all the time nil when I attempt to print it to get response physique, even when request is profitable.

class CustomInterceptor: ApolloInterceptor {

    func interceptAsync<Operation: GraphQLOperation>(
        chain: RequestChain,
        request: HTTPRequest<Operation>,
        response: HTTPResponse<Operation>?,
        completion: @escaping (Swift.Consequence<GraphQLResult<Operation.Information>, Error>) -> Void) {
            let accessToken = KeychainWrapper.normal.string(forKey: "accessToken")
            request.addHeader(identify: "Authorization", worth: accessToken ?? "")
            
            print(accessToken)
            print("request :(request)")
            print("response :(String(describing: response))")
            
            chain.proceedAsync(request: request,
                               response: response,
                               completion: completion)
    }
}

[ad_2]

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments