2 ms·
To be clearer, what I was saying is that you can't predict how much memory you'll need to allocate for a GraphQL response given the particular query you've made
by derefr 10y ago
To be clearer, what I was saying is that you can't predict how much memory you'll need to allocate for a GraphQL response given the particular query you've made, because there's no way to get the server to give you a guarantee that all the field types are scalars or length-limited strings (or arrays of known-typed maps whose members are all scalars or length-limited strings, etc.)
In REST, you can, by Accept-ing only media-types that guarantee such a condition. But there's no way to annotate the "function calls" [field-accessors-with-attributes] that appear within a GraphQL request, to force the GraphQL backend to act in a similar way to a web server with regards to media types of associated fields. You can't say "for this response field, I only Accept these types", and then have the GraphQL backend realize that its response would be unwanted and throw away its work, sending back a 406 error instead.