Hello Apollo community,
I am currently updating our codebase to support RequestChainNetworkTransport interface.
In a previous structure I used HTTPNetworkTransportGraphQLErrorDelegate to catch GraphQLError to initiate access token update and retryHandler to retry faild request.
With the new RequestChain structure I am perfoming same action inside ResponseCodeInterceptor. Though, GraphQLError is not being parced anymore. I am accessing it by response?.parsedResponse?.errors
Here is the response raw data:
{"errors":[{"message":"Access denied","path":["getUserDetails"],"locations":[{"line":2,"column":1}],"extensions":{"code":"accessTokenExpired"}}],"data":null}
Would love to get some help or suggestions where is the right way to fetch GraphQLError this time.
Am I doing something wrong?
Thanks
Please fill in the versions you're currently using:
apollo-ios SDK version: 0.36.0I would probably do this check in an interceptor that runs after LegacyParsingInterceptor - that's where the actual parsing takes place, and after it's gone through that inteceptor, you should be able to access it using response?.parsedResponse?.errors.
The ResponseCodeInterceptor that's provided by default is mostly just checking to make sure the response code is something vaguely sane before attempting to parse the result
Thank you @designatednerd !
I have added a new interceptor AccessTokenValidationInterceptor right after LegacyParsingInterceptor.
Solved. 馃檶
@StanislavCekunov Mind if we close this out?