Fork me on GitHub
#pathom
<
2019-03-27
>
souenzzo00:03:41

@wilkerlucio can I get partial results from pathom? Kind of (partial-parser ctx [{[:user/id 1] [:user/name]}]) => {:result {:user/name "foo"} :ctx {..ctx..}} << here the parser will call the user-by-id, that return's {:user/name "foo" :user/active? true} then if I call (partial-parser ctx-from-the-return [{[:user/id 1] [:user/active?]}]) it will return {:user/active? true} without call user-by-id

wilkerlucio00:03:43

you can send as param to any ident query, so your follow up read will be like: [{([:user/id 1] {:pathom/context ctx-from-the-return}) [:user/active?]}]

wilkerlucio00:03:03

that gets easy to hook in Fulcro load in the :params setting doing an ident load

souenzzo00:03:36

This is nice. But I'm digging use lacinia to expose pathom as a graphql.

mitchelkuijpers12:03:05

That looks very interesting!

fatihict12:03:15

Yeah, we might use this

fatihict12:03:21

in the future

souenzzo13:03:38

nice! i will hack it.

wilkerlucio01:03:32

and for gql compat, its quite easy to implement your own custom attribute to support this same feature, check the sources for the ident reader: https://github.com/wilkerlucio/pathom/blob/master/src/com/wsscode/pathom/connect.cljc#L1367-L1375

eoliphant13:03:15

Hey @wilkerlucio, just got back around to looking at the pagination stuff again. One thing I’m trying to figure out is how to tie generic keys (per @mitchelkuijpers example)

[../has-next?
{:atlas-crm.pagination/items (prim/get-query Entity)}
           {:>/pagination (prim/get-query pagination/Pagination)}]
to the actual data that got resolved from say Entity. I guess in your example, the “paginated collection” resolver is effectively wrapping the “real” collection so it’s more straightforward ?

mitchelkuijpers15:03:27

Do you have the placeholder plugin enabled in your parser?

mitchelkuijpers15:03:47

This is my pagination query if that helps:

[:atlas-crm.pagination/has-next-page?
           :atlas-crm.pagination/has-previous-page?
           :atlas-crm.pagination/size
           {:atlas-crm.pagination/items [:atlas-crm.pagination.items/cursor]}

eoliphant18:03:33

yes I have the placeholder stuff setup. Ok, but what I’m missing I think is how I can, for lack of a better term, “look down” (presumably from some pagination resolver?) at the stuff pointed to/resolved by the ..pagination/items in order to figure out the size, etc.