This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-06-22
Channels
- # babashka (36)
- # beginners (42)
- # calva (6)
- # chlorine-clover (25)
- # cider (31)
- # clara (5)
- # clj-kondo (55)
- # cljdoc (3)
- # cljs-dev (7)
- # cljsrn (3)
- # clojure (73)
- # clojure-brasil (6)
- # clojure-europe (8)
- # clojure-italy (2)
- # clojure-nl (3)
- # clojure-norway (1)
- # clojure-spec (3)
- # clojure-sweden (4)
- # clojure-switzerland (2)
- # clojure-uk (29)
- # clojurescript (93)
- # conjure (21)
- # data-science (14)
- # datomic (19)
- # emacs (4)
- # exercism (3)
- # figwheel-main (38)
- # fulcro (38)
- # graalvm (42)
- # graphql (5)
- # jackdaw (3)
- # jobs (1)
- # joker (2)
- # lambdaisland (1)
- # leiningen (31)
- # malli (8)
- # meander (5)
- # off-topic (27)
- # pathom (2)
- # pedestal (28)
- # re-frame (25)
- # reagent (2)
- # reitit (11)
- # releases (3)
- # remote-jobs (1)
- # rum (1)
- # shadow-cljs (63)
- # spacemacs (17)
- # sql (1)
@andrzej.fricze pathom
and EQL
ecosystem are "another approach" GraphAPI's
you can do a lot of things that graphql do, things that graphql can't do, and maybe there is things that only graphql do.
pathom
has the concept of placeholders
, that you can use to "mimic" HeroNameAndFriends
[{:>/HeroNameAndFriends [{(:hero {:episode episode})
[:name {:friends [:name]}]}]}]
Also, you can create your own a function that merge args
and query
as GraphQL do
(letfn [(apply-args-in-query [{:keys [query args]}]
(->> query
eql/query->ast
(eql/transduce-children (map (fn [{:keys [params] :as node}]
(if params
(assoc node
:params (into {}
(map (fn [[k v]]
[k (get args v v)]))
params))
node))))
eql/ast->query))]
(apply-args-in-query {:query '[{:>/HeroNameAndFriends [{(:hero {:episode :$episode})
[:name {:friends [:name]}]}]}]
:args {:$episode 42}}))
=> [{:>/HeroNameAndFriends [({:hero [:name {:friends [:name]}]} {:episode 42})]}]