Fork me on GitHub
#pathom
<
2021-01-06
>
grzm03:01:03

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

grzm03:01:52

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

wilkerlucio04:01:50

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)

grzm05:01:20

Nice to have another pair of eyes on the code 🙂

grzm05:01:03

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

grzm05:01:45

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

wilkerlucio05:01:25

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

wilkerlucio05:01:56

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/

grzm05:01:12

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

grzm05:01:58

(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)

grzm05:01:29

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

grzm05:01:55

(I guess these are better asked in #fulcro)

bbss06:01:41

fwiw I am using fulcro + pathom3

dvingo23:01:56

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..