Fork me on GitHub

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(


(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}

I use this resolver


FWIW, I’m not getting indices either. Q:

    #uuid "85b4ac42-f4bb-48b8-92bb-b9c3a769d843"
   #uuid "85b4ac42-f4bb-48b8-92bb-b9c3a769d843"
 {:ui/fetch-state { :not-found}}}


This is with the above index resolver.


so after creating the writer


does it need to be jacked into the parser config?


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

👍 4

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 ds (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 ds under some well known key.


I’m dealing with a deep map with no natural idents as far as the eye can see.


;; 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

 {: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)