GraphQL supports query variables (http://spec.graphql.org/draft/#sec-Language.Variables) as a very good way to avoid string-bashing. It's effectively like variables in a SQL prepared statement. Internally, we have extended that with the concept of a server-stored query, where the client sends up a query ID and a variables map; this helps to minimize the size of the request from the client, which can be critical for mobile apps.
hmm the trick with variables can work maybe. This is still not what I was thinking about, but small step further
From the thing I posted yesterday:
(v/graphql-query {:venia/queries [[:employee {:id 1 :active true} [:name :address [:friends [:name :email]]]]]})
=> "{employee(id:1,active:true){name,address,friends{name,email}}}"
Isn't that what you were asking for, @kwladyka?@isak thank you, something like that. But while the library is not maintained 2 years and not popular I am not enough brave to use this 😕
ah ok
Maybe I will find code responsible for that in one of popular libraries which are actively maintained
This is a more maintained venia fork https://github.com/district0x/graphql-query I have been using venia for a long time, it works really well for what I need (adding a pr or two over the time 😉 )
hah I know this repo, I was working for district0x 😉