Fork me on GitHub
#graphql
<
2018-06-10
>
orestis14:06:29

Does Lacinia deal with complexity analysis / security in any way?

hlship17:06:55

How would you quantify that? Ok, now quantify it for all possible apps. Exactly, that's something that really needs to be done by the app itself. You can inject an interceptor after the query has been parsed and before it is executed, where it can access the details needed to determine if the query should be executed.

orestis03:06:04

Ah, great, interceptors is what I didn’t know!

PB19:06:48

Is there any documentation around how I can add new interceptors to lacinia (pedestal version)? From what I can gleem from the code it appears as if I simply add an :interceptors key/value to the service-map?

hlship17:06:35

In 0.8.0, it's simpler, just inject the new interceptor into the seq of interceptors. The new interceptor will be injected before, after, or replacing an existing interceptor. Works sensibly and predictably ... the map approach was in earlier version of lacinia-pedestal.

PB22:06:46

@U04VDKC4G Thanks for the response, I'm afraid I'm a little unsure of how this is intended to be used. Where is this call done? Assuming you're using the default inteceptors, what is the "name" of the interceptor I want it to be before/after/replace?

(-> schema-provider
                            :schema
                            (lp/service-map {:graphiql true})
                            (lp/inject myinterceptor :before "myinterceptor"?) ;; <--- Here maybe?
                            http/create-server
                            http/start)