Skip to content

Instantly share code, notes, and snippets.

Last active May 10, 2019
What would you like to do?
(let [register (pc/resolver `smart-pull
;;maybe not so smart
{::pc/output [:user/foo
(fn [{::p/keys [parent-query]} _]
;; I'm using a d/pull with (eql/focus-subquery output parent-query)
;; if you return data, it will work
(let [data {:user/id 1
:user/foo :foo
:user/bar :bar}
return (p/map-select data parent-query)]
;; it will return just what it's asked for.
(prn {:return return
:ask parent-query})
ctx {::p/reader [pc/reader2
::p/plugins [(pc/connect-plugin {::pc/register register})]
::p/placeholder-prefixes #{">"}}
parser (p/parser ctx)]
(parser ctx `[{:>/a [:user/foo]}
{:>/b [:user/bar]}]))
{:>/a {:user/foo :foo}
:>/b {:user/bar :com.wsscode.pathom.core/not-found}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment