This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-10-31
Channels
- # announcements (5)
- # babashka (105)
- # beginners (92)
- # calva (77)
- # cider (17)
- # cljdoc (8)
- # cljs-dev (8)
- # cljsrn (8)
- # clojure (272)
- # clojure-dev (25)
- # clojure-europe (5)
- # clojure-italy (6)
- # clojure-nl (7)
- # clojure-norway (3)
- # clojure-uk (108)
- # clojurescript (326)
- # code-reviews (4)
- # cursive (6)
- # datomic (37)
- # duct (5)
- # emacs (14)
- # fulcro (23)
- # graphql (1)
- # juxt (1)
- # kaocha (2)
- # leiningen (10)
- # malli (9)
- # music (1)
- # nrepl (12)
- # pathom (21)
- # pedestal (2)
- # planck (4)
- # quil (3)
- # reitit (29)
- # rewrite-clj (10)
- # shadow-cljs (82)
- # spacemacs (29)
- # sql (6)
- # tools-deps (19)
did some more digging, looks like it might be the datomic connect plugin. Took it out, it worked fine started adding it back in
java.lang.RuntimeException: java.lang.Exception: Not supported: class com.wsscode.pathom.connect.datomic$index_schema$fn__34159
at com.cognitect.transit.impl.WriterFactory$1.write(WriterFactory.java:65)
(pc/defresolver index-explorer [{::pc/keys [indexes]} _]
{::pc/input #{:com.wsscode.pathom.viz.index-explorer/id}
::pc/output [:com.wsscode.pathom.viz.index-explorer/index]}
{:com.wsscode.pathom.viz.index-explorer/index (p/transduce-maps
(remove (comp #{::pc/resolve ::pc/mutate}
key))
indexes)})
I use this resolverFWIW, I’m not getting indices either. Q:
[{[:com.wsscode.pathom.viz.index-explorer/id
[:fulcro.inspect.core/app-uuid
#uuid "85b4ac42-f4bb-48b8-92bb-b9c3a769d843"
:remote]]
[:com.wsscode.pathom.viz.index-explorer/id
:com.wsscode.pathom.viz.index-explorer/index]}]
A:
{[:com.wsscode.pathom.viz.index-explorer/id
[:fulcro.inspect.core/app-uuid
#uuid "85b4ac42-f4bb-48b8-92bb-b9c3a769d843"
:remote]]
{:ui/fetch-state {:fulcro.client.impl.data-fetch/type :not-found}}}
@eoliphant I guess you are hitting this: https://wilkerlucio.github.io/pathom/v2/pathom/2.2.0/connect/exploration.html#_fixing_transit_encoding_issues
this has nothing to do with pathom really, its a issue when you try to send things over transit that are not encodable by default (like fns)
my tutorial is to add a default handler so you just send a bogus data, but doens't break the encoding
Is there any way to…
;; Transform…
{:a {:b [d1 d2 d3 … dn]
:c [d1 d2 d3 … dn]}}
;; Into…
{:a {:b {:>/group [d1 d2 d3 … dn]}
:c {:>/group [d1 d2 d3 … dn]}}}
… using placeholders?@henrik I don't understand what you are trying to do, can you tell more about your use case?
Sure, :b
and :c
(and more) return children on the exact same format.
There has to be a group component between :a
and the d
s (I can’t render them directly in the component that has a
as query).
I could make different components for b
and c
etc., but that would be redundant. The other alternative is to destructure both b
and c
in a unified group component, then (or b c)
to render the children.
Alternatively, destructure :b
and :c
in a
, then send the children as props to the group component (which feels a bit funky, I’m conditioned to want props to be a map).
Or, I effectively rename :b
and :c
to something unified that the group component will understand, for which one alternative might be to scope the d
s under some well known key.
;; Data
{:a {:b [d1 d2 d3 … dn]
:c [d1 d2 d3 … dn]}}
;; One component for `a`, one for the `b`/`c` level, one for each `d`
;; Alternative 1
(defsc ComponentForA [this {:keys [b c]}]
(ui-group-comp b)
(ui-group-comp c))
(defsc GroupCompForBorC [this props]
;; Props will be a vector
(map ui-d-comp props))
;; Alternative 2
(defsc ComponentForA [this {:a/keys [b c] :as props}]
(ui-group-comp (select-keys props [b]))
(ui-group-comp (select-keys props [c])))
(defsc GroupCompForBorC [this {:keys [b c]}]
;; Props will be a map of either
;; {:b […]} or {:c […]}
(map ui-d-comp (or b c)))
;; Ideally
(defsc ComponentForA [this props]
??)
(defsc GroupComp [this {:keys [group-of-ds]}]
(map ui-d-comp group-of-ds))
Forget all of the above, it turns out I’m trying to optimize for a pointless scenario.
@henrik glad you reach a point, IME is always good to have some ident to any thing you reference, I did bit myself multiple times when I decided to not have one
It’s not really up to me to decide I’m afraid, I have to work with the data as returned by the API 🙂 There are no idents, so I can’t pretend like there are.
Essentially, it’s
{:search-filters
{:categories [{:title "Biology"
:count 3214}
{:title "Chemistry"
:count 89}
…]
:publishers [{:title "Springer"
:count 212}
…]
:journals [{:title "Nature"
:count 2131}]}}
But with a more complicated naming structure. Not much in there to grab onto as an ident.
yeah, that always sucks... (when you can't control it, but must use it)