4 ms·
Can someone explain why GraphQL was designed to be non-JSON? Seems like a stupid decision, unless I'm missing something.
by not_kurt_godel 9y ago
Can someone explain why GraphQL was designed to be non-JSON? Seems like a stupid decision, unless I'm missing something.
- bostonvaulter2 9y agoWhat would the values of the keys be?
- Sholmesy 9y agoYour question doesn't really make sense. You are specifying the data that you want back from the API. What gain would be using key:value syntax be in this situation? The request would just be littered with `"requested_data": true` which is just wasteful.
- yen223 9y agoEqually important to note: the result of a GraphQL query is valid JSON.
- Sholmesy 9y agoTotally. Just assumed OP meant the request, as the responses are very clearly valid JSON.
- not_kurt_godel 9y agoWell, you could do arrays of strings and objects instead of key:value pairs. Although I suppose there would be a lot of superfluous quotes, and part of the point is to optimize for mobile...