pathom

:pathom: https://github.com/wilkerlucio/pathom/ & https://pathom3.wsscode.com & https://roamresearch.com/#/app/wsscode
grzm 2021-01-06T03:50:03.092500Z

Hello! I'm just getting started with Pathom. My immediate use is to create a mock remote for Fulcro so I can test data loading without actually hooking up a backend. So, this is in cljs. I'm seeing behavior I don't understand when using defresolver. When I use a function call as the outermost part of the body, I get a bunch of ::pc/not-found results. When the outermost part is a map, it "works". Even wrapping the map in an identity call causes me to get the ::pc/not-found results 😕 Here's a gist showing my explorations: https://gist.github.com/grzm/5cc47bbe645651c70fa4bcdad02e6f52

2021-01-09T06:58:41.174400Z

fwiw I am using fulcro + pathom3

grzm 2021-01-06T03:50:52.092600Z

I'm sure it's something simple as I'm new to pathom and relatively inexperienced with cljs, but I'm stumped.

wilkerlucio 2021-01-06T04:57:50.092800Z

hello, welcome to the channel! I gave a read, I see you are using the parallel-parser with reader2, thats a bad combination, I suggest you keep with the regular parser, the parallel-parser is only good in a very specific situations, for most users its unescessary complications. if you need async, use async-parser + async-reader2 also noticed you have a typo in ::pc/output (in your code its ::pc/ouput)

grzm 2021-01-06T05:17:20.093Z

Nice to have another pair of eyes on the code 🙂

grzm 2021-01-06T05:20:03.093200Z

Thanks for the pointers on parallel-parser. I was cribbing from examples I found in the fulcro book code: https://github.com/fulcrologic/fulcro-developer-guide/blob/master/src/book/book/pathom.cljs#L16-L25

grzm 2021-01-06T05:20:45.093500Z

I'm hoping to put together some simple examples of the pieces to share for those starting out.

wilkerlucio 2021-01-06T05:27:25.093700Z

thanks, apprecited, another page you can get some starting samples: https://blog.wsscode.com/pathom/v2/pathom/2.2.0/connect/resolvers.html

wilkerlucio 2021-01-06T05:27:56.093900Z

and the pathom 3 docs can be a nice read too, its more organized, and altough the interface is a bit different on the edges, all the concepts are transferable: http://pathom3.wsscode.com/

grzm 2021-01-06T05:29:12.094200Z

Thoughts on a beginner just starting with Pathom 3, and skipping Pathom 2?

grzm 2021-01-06T05:29:58.094400Z

(with Fulcro, primarily, but from what I gather, they're pretty independent: I'm mostly concerned with not finding examples to learn from as I get started)

grzm 2021-01-06T05:40:29.094600Z

I'm also wondering about the mock-http-server expecting a parser that returns a channel. Though, it looks like I might be able to mock a remote based on https://github.com/fulcrologic/fulcro/blob/932095ba094fae1b7576f85fadd2f6b2eb168ddc/src/workspaces/com/fulcrologic/fulcro/cards/form_cards.cljs#L17-L25

grzm 2021-01-06T05:41:55.094900Z

(I guess these are better asked in #fulcro)

2021-01-06T23:35:56.096300Z

Figured out my problem above while trying to recreate it - the mutation was returning idents for the subtasks when they needed to be maps... So pebcak..