Fork me on GitHub
#pathom
<
2022-02-08
>
sheluchin14:02:43

To make the https://blog.wsscode.com/pathom/v2/pathom/2.2.0/connect/exploration.html#_setting_up_the_index_explorer_resolver in Pathom3, is it just: (get env ::pc/indexes) -> (get env ::pci/indexes)?

wilkerlucio14:02:40

in Pathom 3 you just need to use the boundary interface (https://pathom3.wsscode.com/docs/eql/#boundary-interface), and it sets up the index explorer support automatically, or using the pathom connector, which also makes it automatically

wilkerlucio14:02:40

if you are trying to support on some HTTP API, also make sure you setup the encoding to use transit, and use the transit readers/writers from pathom, so it can encode/decode resolvers and mutations

sheluchin17:02:57

Hmm, I'm just trying to upgrade my Fulcro to use Pathom3. Everything seems to be working, except EQL autocomplete and the index explorer. I get this error:

I 2022-02-08T17:41:46.254Z                       _rad.pathom-common:- 28 - Request:  [{[:com.wsscode.pathom.viz.index-explorer/id [:fulcro.inspect.core/app-uuid #uuid "85fd9b5b-0a33-4c9e-8ded-2a0dd2f4d4a6" :remote]] [:com.wsscode.pathom.viz.index-explorer/id :com.wsscode.pathom.viz.index-explorer/index]}]
E 2022-02-08T17:41:46.256Z                             _rad.pathom3:- 31 - EQL query for :com.wsscode.pathom.viz.index-explorer/index cannot be resolved. Is it spelled correctly? Pathom error: {:com.wsscode.pathom3.error/cause :com.wsscode.pathom3.error/attribute-unreachable}
I 2022-02-08T17:41:46.257Z                       _rad.pathom-common:- 28 - Response:  {[:com.wsscode.pathom.viz.index-explorer/id [:fulcro.inspect.core/app-uuid #uuid "85fd9b5b-0a33-4c9e-8ded-2a0dd2f4d4a6" :remote]] {:com.wsscode.pathom.viz.index-explorer/id [:fulcro.inspect.core/app-uuid #uuid "85fd9b5b-0a33-4c9e-8ded-2a0dd2f4d4a6" :remote]}}
My code is based on the https://github.com/fulcrologic/fulcro-rad-demo/blob/1d8b7b1bba31aca925335f35f8b1486c6a25d4a0/src/xtdb/com/example/components/parser.clj#L29 and that call to pathom3/new-processor does use the boundary interface: https://github.com/fulcrologic/fulcro-rad/blob/fulcro-rad-1.1.6/src/main/com/fulcrologic/rad/pathom3.clj#L112

wilkerlucio17:02:24

are you trying on Pathom viz or Fulcro Inspect?

wilkerlucio17:02:31

because Fulcro Inspect doesn't support Pathom 3 at this time

sheluchin17:02:13

Ah! That makes sense. I was trying to use Inspect. I'll try setting up Viz.

sheluchin20:02:29

@U066U8JQJ I'm not sure how to get Viz working with the rad demo code. I still need to use the connector, right? If so, where do I use it in the parser setup? Is this something I need to read the plugins page to understand? Haven't got to that one yet..

wilkerlucio20:02:24

the config should be very similar to the JVM one, Pathom 3 doesn't have the concept of a parser, so its about configuring the env when defining it

wilkerlucio20:02:14

the connector will do all the nescessary extensions (like exposing the indexes), so it should work strait from there, maybe its easy for you to try setting up it first without fulcro, and them placing it there (after all, its a differnet wrapping the call to the eql processor)

wilkerlucio20:02:36

I'm assuming in this case you are making a CLJS Pathom configuration, right?

sheluchin20:02:16

I've got it working in the GraphQL GitHub demo. That was my first step, and now I'm trying to use it with my Fulcro project. This is for the backend parser to connect to my database, as shown here: https://github.com/fulcrologic/fulcro-rad-demo/blob/1d8b7b1bba31aca925335f35f8b1486c6a25d4a0/src/xtdb/com/example/components/parser.clj#L22-L29

sheluchin20:02:35

It's that call to RAD's pathom3/new-processor that registers the indexes, which is where I set up the connector in the GraphQL repo, but don't know how to inject it into the logic here.

wilkerlucio13:02:32

I dont have a lot of contexto on the RAD implementation, at some place you should be able to change env things

sheluchin13:02:58

Thanks @U066U8JQJ but it's okay. I don't want to distract you from your work too much if the answer isn't something obvious. If I figure it out I will commit some docs somewhere to explain it.

sheluchin13:02:37

Not the end of the world. It's alpha stage and I wanted to provide feedback around friction points I'm personally seeing, but I still have a lot to learn here so take it with a grain of salt 🙂

wilkerlucio13:02:41

no worries, I appreciate all the feedback, better to know the pain points 🙂

gratitude-thank-you 1