Fork me on GitHub

are there any diagrams or docs for the interceptor flow that lacinia-pedestal implements outside of the API docs?


I’m having a similar question — I’d like to include lacinia-pedestal’s interceptors as part of another service map and routes. So /graphql, /graphql-ws and /_graphiql would be just 3 routes inside a much larger route specification. I’d also like to add my own interceptors (e.g. authentication, rate limiting and so on) in front of them. What is the recommended way to do that?


yeah, that's how I've been trying to piece it together


I haven't gotten to actually reading the code but I think that's what I'm going to have to do


I was thinking of adding a transformation stage, so that a resolver could return a query and then it's children could manipulate the query, before doing the actual GraphQL JSON stage


It's grown a bit haphazardly from specific code needed to setup for our own servers, to something more general that can be used a bit piecemeal to setup something else. So there's the simple route, just use service-map or the intermediate approach (pass some options to service-map) or the heavy approach: reuse bits and pieces of code called from service-map.


All the business about interceptors and inject is so that if you make a change to the lacinia-pedestal interceptor chain for release N, when you upgrade to N+1 your changes should still work, even if lacinia-pedestal has added new interceptors to its default chain.


Thanks! Nice to know the reasoning about things.