apollo-kotlin
apollo-kotlin copied to clipboard
Display error message from server on introspection errors
Use case
When Supabase encounters a malformed comment, it returns an error to introspection requests. It would be nice to see that error.
Describe the solution you'd like
Currently when the server has an error, ./gradlew downloadServiceApolloSchemaFromIntrospection displays this message:
java.lang.Exception: Introspection response from http://127.0.0.1:54321/graphql/v1 can not be parsed
The response from the server was:
{
"data": null,
"errors": [
{
"message": "invalid input syntax for type json"
}
]
}
In that case, it would be nice if Apollo gracefully handled the error and displayed the message from the server.
We could certainly improve the message. Passing --stacktrace to the gradle invocation does show more info but only the first 50 characters of the received document are shown.
Thanks! I did run it with --stacktrace, but I didn't notice that the message was actually in the output.
@sproctor https://github.com/apollographql/apollo-kotlin/pull/6590 displays a small hint that there is more information in the rest of the stacktrace. Hopefully that will make it easier to parse the output. Let us know what you think!