Fork me on GitHub

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, 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.


Or at the very least "... and additional options passed to function gnip-gnop"


I sent a PR to at least add that one option to the (service-map) docstring, since that’s what tripped me up specifically.