Fork me on GitHub
#pathom
<
2020-04-22
>
jmayaalv05:04:51

After following the instructions to build Pathom-Viz i get this when running the app: main.js:1 Failed to load resource: net::ERR_FILE_NOT_FOUND

jmayaalv05:04:27

this is on macos. kind of clueless what am i doing wrong, any pointers?

Jakub Holý (HolyJak)10:04:40

Hello! What is the difference between https://wilkerlucio.github.io/pathom/ and https://wilkerlucio.github.io/pathom/v2/pathom/2.2.0/ (except the look & feel)? The former seems also to cover v2.2.0 based on the fact it has the section "https://wilkerlucio.github.io/pathom/#_2_2_0_upgrade_guide"? I would like to convert it into PDF for reading on my Kindle and thus the single-page /pathom/ is much better than the multipage /v2/. Thanks!

Jakub Holý (HolyJak)13:04:20

I am looking at https://wilkerlucio.github.io/pathom/v2/pathom/2.2.0/graphql/fulcro.html#_setting_up_connect_with_graphql, do I understand correctly that the only place that binds the defined GraphQL endpoint (`github-gql`) is when it is used to load indexes (https://wilkerlucio.github.io/pathom/v2/pathom/2.2.0/graphql/fulcro.html#_loading_the_graphql_schema_and_creating_a_remote)? I guess Pathom Connect then has all info necessary in the indexes, so it can call the GQL endpoint when necessary? And, BTW, is it possible to configure the endpoint more? In particular I need to include a header with an API token. I guess I just add ::p.http/headers {"x-api-key" "123"} to the endpoint's def , right? But what if the header is dynamic and depends on some other stuff from the environment? (For some queries, I also need to include the id of the user making the request; but it is expected to be provided as a header, not a query param.)

Chris O’Donnell13:04:43

@holyjak Your understanding is correct about loading indices. I've added a bearer token dynamically to requests using a parser plugin like this:

(def auth-plugin
  {::p/wrap-parser
   (fn [parser]
     (fn [env tx]
       (parser
         (assoc-in env [::p.http/headers :authorization] (str "Bearer " (get-token)))
         tx)))})

❤️ 8
Jakub Holý (HolyJak)14:04:31

Awesome! Thanks a lot!

👍 4
jmayaalv15:04:52

hello, totally newbie with pathom here. i am trying to setup worskpaces with a pathom-viz card. is there any example/doc to follow when pathom is running on clj? example here: https://wilkerlucio.github.io/pathom/v2/pathom/2.2.0/connect/exploration.html passes a parser, but how to pass a parser when pathom is running on clj and not cljs?

jmayaalv16:04:28

am i correct assuming that it should be something similar to standalone ?