Hacker News new | past | comments | ask | show | jobs | submit login

Can someone explain why GraphQL was designed to be non-JSON? Seems like a stupid decision, unless I'm missing something.



Your 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.


Equally important to note: the result of a GraphQL query is valid JSON.


Totally. Just assumed OP meant the request, as the responses are very clearly valid JSON.


Well, 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...


What would the values of the keys be?




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: