This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-08-21
Channels
- # announcements (20)
- # beginners (31)
- # biff (8)
- # cherry (5)
- # cider (4)
- # cljs-dev (1)
- # clojure (26)
- # clojure-australia (2)
- # clojure-europe (16)
- # clojure-spec (10)
- # community-development (8)
- # conjure (1)
- # core-async (1)
- # data-oriented-programming (1)
- # data-science (54)
- # datascript (10)
- # fulcro (1)
- # graalvm (2)
- # malli (5)
- # off-topic (3)
- # pathom (23)
- # rdf (1)
- # re-frame (6)
- # reitit (11)
- # shadow-cljs (6)
- # squint (2)
- # xtdb (33)
trying to use pathom-viz-connector from within a container. I can curl the pathom-viz IP:8240 from inside the container, and :com.wsscode.pathom.viz.ws-connector.core/host
is set to that IP, but nothing's showing up in pathom-viz. I looked at the code https://github.com/wilkerlucio/pathom-viz-connector/blob/1d2662b410f262f74da542b7743b23f1438e3adb/src/com/wsscode/pathom/viz/ws_connector/impl/http_clj.clj and it looks like host
and port
might be ignored in the clj impl?
also is there any built-in code to do this for pathom3 https://cljdoc.org/d/com.wsscode/pathom/2.4.0/doc/pathom-developers-guide#_setting_up_the_index_explorer_resolver
Pathom 3 does this automatically via the boundary interface
wait, maybe not, let me check something
yup, thats right, boundary interface does it, you can copy from it if you like to do it without using the boundary context: https://github.com/wilkerlucio/pathom3/blob/1e440a61243dc1dea59e4946ebffc4ac424253f4/src/main/com/wsscode/pathom3/interface/eql.cljc#L176
what do I need on my end? I thought the boundary interface was a client api, so pathom-viz does it. I just have the parser http endpoint
you should use the boundary interface in your http handler, so it supports the pathom API format and also include indexes (which will make index explorer available)
also your endpoint needs spit transit, with the transit encoders setup
this tutorial has a sample of doing this setup: https://pathom3.wsscode.com/docs/tutorials/serverless-pathom-gcf
can I get traces from the Query tab of pathom-viz or is that only through the connector
you should be able to get traces too, but there is one more thing you have to do, that is expose the metadata of the entities via transit
the :transform t/write-meta
on the example config tutorial
(this is a transit config, if you are using it directly you should be able to set it there)
that's because trace info comes via metadata in the response maps
hm, one resolver returns a response with its own metadata, where the metadata contains a function, so it can't be serialized. Is this bad practice to have metadata in my output?
ideally nothing should break serialization
I made this wrapper on Transit just to get this working properly: https://github.com/wilkerlucio/transito
what you need is to set the transit default handler to some "unknown" thing, so it can output it, I had issues in the past trying to make that strait on transit writer, so I have written my own writer that does it, maybe nowadays its fixed in Transit and you can just configure there instead of making a custom Writer
I might just refactor this to get rid of the metadata. The problem it's solving is setting a cookie from mutation, so the metadata is a function run by the ring handler to transform the response
it seems pretty easy to set the default handler now, just :default-handler (transit/write-handler (fn [￱_￱] "unknown") #(pr-str %))
in muuntaja's :encoder-opts
Datalevin Pathom 3 Dynamic resolver https://github.com/RokLenarcic/datalevin-pathom