This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-06-28
Channels
- # adventofcode (12)
- # announcements (1)
- # asami (18)
- # aws (1)
- # babashka (20)
- # beginners (80)
- # calva (11)
- # cider (10)
- # circleci (5)
- # cljsrn (2)
- # clojure (37)
- # clojure-australia (15)
- # clojure-europe (32)
- # clojure-nl (2)
- # clojure-uk (26)
- # clojured (7)
- # clojurescript (10)
- # clojurewerkz (3)
- # cursive (45)
- # data-science (12)
- # datomic (3)
- # emacs (8)
- # events (3)
- # fulcro (23)
- # graphql (5)
- # helix (3)
- # jobs (1)
- # jobs-discuss (1)
- # juxt (3)
- # lsp (12)
- # malli (4)
- # meander (4)
- # reagent (11)
- # releases (1)
- # shadow-cljs (28)
- # sql (35)
- # tools-deps (9)
- # xtdb (25)
https://lacinia.readthedocs.io/en/latest/directives.html
is there any update on directive
topic?
I’m trying to use directives for authentication purpose. Has anybody ever tried this using lacinia?
Well kinda, we have a @possibleTypes
directive (like GH also has) and we have a function that wraps a lacinia resolver fn and checks those types / if all is right calls the actual resolver.. But there is nothing automatic here, you really need to remember to wrap your resolver
So like this:
(defn with-possible-type-check
[resolver-fn]
(fn [ctx args val]
(if (possible-types-correct? ctx args val)
(resolver-fn ctx args val)
(resolve-as nil {:message "Nope"}))))
👍 2
Here be dragons tho, in possible-types-correct?
we navigate the parsed directives in ctx
, that isn’t promised to be stable, so breaking is on us 😉