Exactly, it seems like they could have used introspection to get all the data they need.
Hi -- how do I get the parsed query from the request? I need to check it as @hlship described above.
It's is placed onto the :request object as key :parsed-lacinia-query. (see https://github.com/walmartlabs/lacinia-pedestal/blob/78077efc551d2fc1744f3b17c4ddf9ee3616668d/src/com/walmartlabs/lacinia/pedestal2.clj#L97)
Thanks @hlship! I was having a hard time finding from my logs.
Breaking the logic up into a bunch of interceptors makes it possible to "slip" in
extra logic, like auth/auth, etc.
But it means that the logic is a bit scattered about.
Fortunately, it's only a little bit of code either way.
(defn ^:private interceptors
[schema]
(-> (p2/default-interceptors schema nil)
(inject user-info-interceptor ::after ::p2/inject-app-context)))
is this example supposed to work?
https://lacinia-pedestal.readthedocs.io/en/latest/interceptors.html
the ::p2/inject-app-context
doesn't seem like valid syntax
and idk what the actual interceptors are named
Yes, I believe that is correct; that's the inject-app-context
keyword in the p2
namespace (alias for com.walmartlabs.lacinia.pedestal2
). See https://walmartlabs.github.io/apidocs/lacinia-pedestal/com.walmartlabs.lacinia.pedestal2.html#var-default-interceptors for the default list/names.
There is a typo on that page, ::after
should be :after
.
I'll fix.