Fork me on GitHub
#graphql
<
2020-09-10
>
hadils16:09:25

Hi -- how do I get the parsed query from the request? I need to check it as @hlship described above.

hadils16:09:30

Thanks @hlship! I was having a hard time finding from my logs.

hlship16:09:05

Breaking the logic up into a bunch of interceptors makes it possible to "slip" in

hlship16:09:10

extra logic, like auth/auth, etc.

hlship16:09:18

But it means that the logic is a bit scattered about.

hlship16:09:24

Fortunately, it's only a little bit of code either way.

emccue17:09:13

(defn ^:private interceptors
  [schema]
  (-> (p2/default-interceptors schema nil)
      (inject user-info-interceptor ::after ::p2/inject-app-context)))

emccue17:09:19

is this example supposed to work?

emccue17:09:41

the ::p2/inject-app-context doesn't seem like valid syntax

emccue17:09:50

and idk what the actual interceptors are named

hlship18:09:47

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.

hlship21:09:32

There is a typo on that page, ::after should be :after.