I'm using Apollo Client v3.5.10 in React Native in a project managed by Expo v44.0.6. Occasionally, a GraphQL query returns an error that says Unexpected token < in JSON at position 0
. I understand this means the server is returning HTML instead of well-formatted JSON.
Does anyone know how to see this raw response via code? I can see it in the Network inspector within the iOS Simulator (often a 404), but this is very inconvenient and doesn't help me in production.
I've tried creating an error link via onError (from @apollo/client/link/error). It works, but is only able to show me that same 'Unexpected token...' message. I haven't figured out if there's a way to see the actual raw HTML response or get the status via code.
Any help would be greatly appreciated.