I'm integrating Apollo GraphQL into a SwiftUI app and encountering the following error during a query execution:
result : failure(Apollo.MultipartResponseParsingInterceptor.ParsingError.cannotParseResponse)
failed : The response data could not be parsed.
The request hits the server, but the response fails to be parsed by Apollo. I'm using the default code generation setup and executing a simple query to fetch a list of countries.
Here’s a snippet of the function:
swift Copy Edit private func fetchCountries() { switch result { case .success(let graphQLResult): if let name = graphQLResult.data?.countries { print(name) } else if let errors = graphQLResult.errors { print(errors) } case .failure(let error): print("failed : (error.localizedDescription)") } }
This is run on an iPhone 16 Pro simulator with iOS 18.2. Any idea what's causing the parsing error or how I can inspect the raw response for debugging?
Thanks in advance!
It’s possible that someone else might chime here but, in general, if you have questions about a third-party library, it’s best to ask them via the support channel for that library. DevForums is primarily focused on Apple stuff.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"