This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-03-10
Channels
- # announcements (1)
- # babashka (44)
- # beginners (188)
- # calva (37)
- # chlorine-clover (28)
- # cider (12)
- # clj-kondo (40)
- # clojars (1)
- # clojure (323)
- # clojure-austin (7)
- # clojure-europe (20)
- # clojure-italy (4)
- # clojure-nl (16)
- # clojure-spec (7)
- # clojure-uk (37)
- # clojuredesign-podcast (1)
- # clojurescript (30)
- # cryogen (2)
- # cursive (30)
- # data-science (1)
- # datomic (26)
- # emacs (1)
- # events (1)
- # figwheel-main (13)
- # fulcro (89)
- # garden (1)
- # graalvm (20)
- # graphql (8)
- # jobs (1)
- # jobs-discuss (1)
- # joker (6)
- # kaocha (125)
- # lambdaisland (1)
- # meander (42)
- # off-topic (18)
- # pathom (3)
- # pedestal (6)
- # shadow-cljs (55)
- # spacemacs (21)
- # sql (18)
- # tools-deps (8)
- # uncomplicate (2)
- # vim (1)
- # yada (3)
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 😕
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 😉 )