Fork me on GitHub

trying to use pathom-viz-connector from within a container. I can curl the pathom-viz IP:8240 from inside the container, and is set to that IP, but nothing's showing up in pathom-viz. I looked at the code and it looks like host and port might be ignored in the clj impl?

👀 1

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:


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


ok, that was really easy to change. thanks :)


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:


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