3 ms·
> Stringly type is too hard to be manipulated. With param and fragments, the json would be too verbose, so you'd end up by always building your queries program
by tuyiown 7y ago
> Stringly type is too hard to be manipulated.
With param and fragments, the json would be too verbose, so you'd end up by always building your queries programmatically, so sharing queries between GraphQL implementations and/or runtimes/languages would be harder.
GraphQL language for queries and schema adds a layer that describe what your runtime and/or compile time has to conform with, which is incredibly helpful for stacks with heterogeneous environment.
In the end, you can always parse and generate those full text documents and manipulate them programmatically, as much as you want (just be cautious with perfs). So the apparent fragility has many ways to be addressed, with a huge advantage of having common ground on all stacks.
- revskill 7y agoWith JSON, you have many benefit, such as syntax error for JSON. It's impossible with stringly type. With dynamically generation of query, JSON parsing is easier than stringly type. You don't need a library like graphql-tag to do that. Instead of posting a string body request, you post a JSON request, which is the standard way for long time. In general, stringly type graphql query is not a fine choice to me.