You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working on a Compose Multiplatform project using Apollo Kotlin 4 for GraphQL communication. When I attempt to log in with incorrect credentials, the server sends a JSON response containing a GraphQL error:
However, my Apollo client is throwing an ApolloNetworkException with the message "Http request failed with status code 403" and doesn't provide access to the actual GraphQL error details.
Interestingly, when I test the same mutation in Postman, it correctly displays the GraphQL error response.
My question is:
What could be causing this discrepancy between the Apollo client and Postman? Is there a configuration issue on the client or server side? How can I properly catch and handle this GraphQL error response in my Apollo Kotlin code so I can display the "Incorrect username or password" message to the user?
The text was updated successfully, but these errors were encountered:
Hi 👋 It's a long story but any non-200 response isn't parsed as a GraphQL response. This is something the GraphQL over HTTP effort aims to fix.
If your server is using the new application/graphql-response+json content-type, we can fix that in Apollo Kotlin, this is something that I've been wanting to do for a while now. If not, you'll have to go through some extra hoops of using exposeHttpErrorBody (see this stack overflow answer).
Question
I'm working on a Compose Multiplatform project using Apollo Kotlin 4 for GraphQL communication. When I attempt to log in with incorrect credentials, the server sends a JSON response containing a GraphQL error:
{ "errors": [ { "extensions": { "reason": "Incorrect username or password.", "show_resend": false } } ] }
However, my Apollo client is throwing an ApolloNetworkException with the message "Http request failed with status code 403" and doesn't provide access to the actual GraphQL error details.
Interestingly, when I test the same mutation in Postman, it correctly displays the GraphQL error response.
My question is:
What could be causing this discrepancy between the Apollo client and Postman? Is there a configuration issue on the client or server side? How can I properly catch and handle this GraphQL error response in my Apollo Kotlin code so I can display the "Incorrect username or password" message to the user?
The text was updated successfully, but these errors were encountered: