graphql-over-http icon indicating copy to clipboard operation
graphql-over-http copied to clipboard

Question regarding well-formedness of GQL over http responses

Open duzinkie opened this issue 3 months ago • 5 comments

Hello,

When discussing some issues that appeared when trying to integrate https://github.com/apollographql/apollo-kotlin and https://github.com/google/cronet-transport-for-okhttp (specifically: https://github.com/apollographql/apollo-kotlin/issues/5885) and in the course of this discussion, we encountered something that we're not sure about how to interpret and would appreciate a clarification.

Specifically, the current implementation of the GQL client in https://github.com/apollographql/apollo-kotlin was only reading a json response up to point it reaches the end of the "logical" end of a json payload, and technically if there's anything else past that send in the response, it would be ignored. In practical applications we're working with, there's indeed nothing past that, but we're wondering what should be a client behavior if that's not the case - should such a response then by rejected by a client due to not being "well-formed" given the specs are mentioning it must be:

When a server receives a well-formed GraphQL-over-HTTP request, it must return a well‐formed GraphQL response

https://graphql.github.io/graphql-over-http/draft/#sec-Response

duzinkie avatar May 16 '24 18:05 duzinkie