Fork me on GitHub
#pathom
<
2019-09-11
>
cjsauer16:09:29

Is it possible/easy to use Pathom Viz when not using Fulcro?

kszabo16:09:35

I will be working on a bit more sophisticated version available as an nginx served SPA within a docker-image in the near future

kszabo16:09:49

for now you have to build it/deploy it yourself

cjsauer16:09:49

Oh cool, thank you for the link. Is a “pathom server” a standardized thing? I imagine it makes assumptions on how the parser is actually exposed via HTTP. This is likely documented somewhere, I may need to RTFM 🙂

cjsauer16:09:49

Ah, this is a good hint: https://github.com/wilkerlucio/pathom-viz/blob/b2349e68b011672796c4ed96a8dea7b7bb9491be/src/core/com/wsscode/pathom/viz/standalone.cljs#L25-L30 Looks like the query is encoded in form params the body as transit+json, and the response is sent in the body, also as transit+json

cjsauer16:09:55

I’ve been reading through Fulcro’s networking implementation, and it also seems to use a similar approach (except for maybe sending the query as form-params)

cjsauer16:09:59

Oh I may have misunderstood. The ::p.httml/form-params key derives content type from ::content-type https://github.com/wilkerlucio/pathom/blob/9b4c4a6bd07ec5ec570c0596eb446853e2904eed/src/com/wsscode/pathom/diplomat/http.cljc#L35-L37

cjsauer17:09:03

Are these com.wsscode.pathom.diplomat.* namespaces meant to be a general solution to using pathom over the network, or are they mainly intended to be used for development/tooling?

wilkerlucio17:09:17

@cjsauer the diplomat idea is to abrastract away the impl between cljs and clj, this way we can have resolver collections that work on both (just having to replace the HTTP driver)

wilkerlucio17:09:45

@thenonameguy thanks for pointing that out, to be honest I had forgot about it, but just add on my todo list, will try to check and merge it ASAP

🥂 4
cjsauer17:09:37

Ohh okay, so the diplomat is meant to be used within resolver implementations? That makes sense.

cjsauer17:09:18

I see. And so that resolver would work on both client and server.

wilkerlucio17:09:33

yeah, given you provide a compatible http driver 🙂 (which is a fn that understand the keywords we send)

cjsauer17:09:51

Got it. Thank your for the example Wilker.