This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-07-13
Channels
- # aleph (15)
- # announcements (4)
- # babashka (36)
- # babashka-sci-dev (1)
- # beginners (15)
- # biff (2)
- # calva (15)
- # cider (3)
- # clj-kondo (8)
- # clojure (149)
- # clojure-europe (14)
- # clojure-norway (13)
- # clojure-switzerland (1)
- # clojure-uk (1)
- # clojurescript (21)
- # community-development (5)
- # cursive (20)
- # data-science (2)
- # datomic (7)
- # duct (5)
- # emacs (19)
- # etaoin (3)
- # events (2)
- # fulcro (11)
- # introduce-yourself (2)
- # jobs (4)
- # jobs-discuss (19)
- # joyride (1)
- # leiningen (11)
- # malli (7)
- # membrane (131)
- # nbb (12)
- # nginx (1)
- # off-topic (33)
- # pathom (8)
- # polylith (28)
- # re-frame (8)
- # sci (7)
- # shadow-cljs (225)
- # spacemacs (10)
- # specter (1)
- # vim (10)
- # xtdb (8)
👋 Hello folks! Is there a way to generate a query from an existing sample data structure? The closest I could find is the shape-descriptor https://pathom3.wsscode.com/docs/shape-descriptor, but I wanted to have the corresponding query for it, already in EQL. Basically I have this:
{:user/name "usuario"
:user/billing-card {:card/number "123"}
:user/friends [{:user/id 1}
{:user/id 2}]}
And I wanted this:
[:user/name
{:user/billing-card [:card/number]}
{:user/friends [:user/id]}]
(Mine is a much more complex data structure with way more nested fields, hence the question)#meander or something similar might be helpful in a case like this. Not sure if Pathom itself has any helpers.
@U9V0ZDFB7 https://cljdoc.org/d/com.wsscode/pathom3/2022.07.08-alpha/api/com.wsscode.pathom3.format.eql#data-%3Equery
@U066U8JQJ wow, thanks! I was able to get it using https://gist.github.com/rodolfo42/12b02412058d3f57827a105133779da9 I just wrote, probably full of corner cases, but nice to know I can use that fn!
For posterity, here is the corresponding version in Pathom 2: https://cljdoc.org/d/com.wsscode/pathom/2.4.0/api/com.wsscode.pathom.connect#data-%3Eshape