This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-06-14
Channels
- # announcements (2)
- # aws (12)
- # aws-lambda (5)
- # beginners (42)
- # calva (56)
- # cider (16)
- # clj-kondo (1)
- # cljs-dev (45)
- # cljsjs (1)
- # cljsrn (25)
- # clojure (171)
- # clojure-europe (3)
- # clojure-italy (16)
- # clojure-losangeles (2)
- # clojure-nl (49)
- # clojure-spec (2)
- # clojure-sweden (3)
- # clojure-uk (11)
- # clojurescript (84)
- # component (11)
- # core-async (12)
- # core-logic (2)
- # cursive (8)
- # datomic (41)
- # events (2)
- # fulcro (48)
- # graalvm (1)
- # graphql (1)
- # hoplon (12)
- # jackdaw (1)
- # jobs (1)
- # jobs-discuss (45)
- # joker (5)
- # keechma (10)
- # nyc (3)
- # off-topic (14)
- # pathom (16)
- # qa (1)
- # re-frame (22)
- # reagent (12)
- # reitit (4)
- # remote-jobs (1)
- # shadow-cljs (40)
- # spacemacs (3)
- # timbre (3)
- # tools-deps (29)
[com.wsscode.pathom "2.2.15"
is out! Changes:
* Fix pc/data->shape breaking when data has complex keys
* Fix alias on p/join-seq-parallel optimized runs (https://github.com/wilkerlucio/pathom/issues/89)
also updated docs for placeholders: https://wilkerlucio.github.io/pathom/#_placeholders thanks to @tony.kay for pointing the missing full examples
Any obvious places to look if the index-explorer isn't working? When I try to connect I get an error like this java.lang.RuntimeException: java.lang.Exception: Not supported: class <one of my resolvers>
@uwo the issue that happens here is because its likely trying to encode things in transit that it doesn't know about, my suggestion is to use transit default handlers so it encode it anyway (even if it can't properly read on the other side, doesn't matter, those keys are not going to be read anyway)
I really need to add this to the docs there
specially because there is a bug in transit where the default write handlers don't work, so there is some code needed to make that work
(deftype DefaultHandler []
WriteHandler
(tag [this v] "unknown")
(rep [this v] (pr-str v)))
(defn writer
"Creates a writer over the provided destination `out` using
the specified format, one of: :msgpack, :json or :json-verbose.
An optional opts map may be passed. Supported options are:
:handlers - a map of types to WriteHandler instances, they are merged
with the default-handlers and then with the default handlers
provided by transit-java.
:transform - a function of one argument that will transform values before
they are written."
([out type] (writer out type {}))
([^OutputStream out type {:keys [handlers transform default-handler]}]
(if (#{:json :json-verbose :msgpack} type)
(let [handler-map (merge transit/default-write-handlers handlers)]
(transit/->Writer
(TransitFactory/writer (#'transit/transit-format type) out handler-map default-handler
(when transform
(reify Function
(apply [_ x]
(transform x)))))))
(throw (ex-info "Type must be :json, :json-verbose or :msgpack" {:type type})))))
then you can write with
(defn write-transit [x]
(let [baos (ByteArrayOutputStream.)
w (writer baos :json {:handlers transit-write-handlers
:default-handler (DefaultHandler.)})
_ (transit/write w x)
ret (.toString baos)]
(.reset baos)
ret))
ok people, new section in the docs, how to fix transit encoding issues: https://wilkerlucio.github.io/pathom/#_fixing_transit_encoding_issues
Has anyone here attempted to integrate vim omni-completion, ctrl-x-o, with pathom-index enabled autocompletion?
@uwo not that I know, but if you have a running repl with pathom and the index, and you can communicate with that, the impl can be quite easy
this fn does all the heavy lifting: https://github.com/wilkerlucio/pathom/blob/master/src/com/wsscode/pathom/connect.cljc#L1522
ctx
is a vector with a path, examples: [:customer/id]
, [:my-app/all-users :user/groups]
cache is optional, but can do great on improving performance, just send an atom with a map (and hold this atom, keep sending the same one)