graphql

hlship 2020-03-10T02:14:01.051900Z

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.

kwladyka 2020-03-10T09:03:10.053200Z

hmm the trick with variables can work maybe. This is still not what I was thinking about, but small step further

isak 2020-03-10T15:46:34.054100Z

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?

kwladyka 2020-03-10T15:48:02.055Z

@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 😕

isak 2020-03-10T15:48:28.055600Z

ah ok

kwladyka 2020-03-10T15:48:40.056Z

Maybe I will find code responsible for that in one of popular libraries which are actively maintained

2020-03-10T16:02:35.057100Z

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 😉 )

1
kwladyka 2020-03-10T18:17:06.058900Z

hah I know this repo, I was working for district0x 😉