This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-01-07
Channels
- # adventofcode (4)
- # aleph (1)
- # architecture (9)
- # beginners (67)
- # boot (7)
- # boot-dev (12)
- # cider (3)
- # clojure (166)
- # clojure-austin (3)
- # clojure-estonia (1)
- # clojure-greece (2)
- # clojure-russia (5)
- # clojure-spec (1)
- # clojure-uk (4)
- # clojurescript (19)
- # cursive (1)
- # data-science (5)
- # datascript (4)
- # datomic (3)
- # docs (10)
- # emacs (24)
- # events (4)
- # fulcro (16)
- # graphql (8)
- # hoplon (2)
- # jobs-discuss (1)
- # leiningen (5)
- # off-topic (2)
- # planck (30)
- # re-frame (20)
- # reagent (36)
- # ring (3)
- # shadow-cljs (5)
- # spacemacs (1)
- # specter (2)
Say, I feel like I may have asked this before, but my google-fu is failing me. I’m trying to figure out how to use (inject-app-context-interceptor)
in lacinia-pedestal
to add a db connection into my app-context where the resolvers can get to it. I’m starting from the sample code from the README.md, and I have no idea where I should place the call to (inject-app-context-interceptor)
.
I tried including it in the :interceptors
option to (lacinia/service-map)
but got a an assertion failure Assert failed: (some? interceptor)
at com.walmartlabs.lacinia.pedestal.interceptors:7
I guess I don’t understand what the API is between (service-map)
and (inject-interceptor)
Aha! It seems like I just needed to pass my context as the :app-context
option key to (service-map)
The options supported by service-map are documented but scattered about across a couple of functions it calls; they should be organized together, even if there ends up being some repetition.
I sent a PR to at least add that one option to the (service-map)
docstring, since that’s what tripped me up specifically.