Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
(defn username-by-id
{::pc/kind pc/resolver
::pc/input #{:app.user/id}
::pc/output [:app.user/username]}
[{::keys [db]} {:app.user/keys [id]}]
{:app.user/username (-> (j/query db ["SELECT username FROM app_user WHERE id = ?"
id])
first
:username)})
(let [var->resolve (fn [x]
(let [sym (symbol x)
{::pc/keys [kind] :as options} (meta x)]
(kind sym options @x)))]
(var->resolve #'username-by-id))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.