Fork me on GitHub
#graphql
<
2018-05-08
>
hlship16:05:06

There are two broad approaches to providing such dependencies in Lacinia. The first is to stuff things in the context, with the knowledge that the context will be passed around to all the resolver functions that need it. The second is to define resolvers as instances of the FieldResolver protocol, and use com.stuartsierra/component to wire everything up. You can mix and match within the same schema if you like. I prefer to keep anything non-trivial as a component, but that's because I like pretty pictures (https://github.com/walmartlabs/system-viz) 😎

geraldodev17:05:56

I'm enjoying the fact that lacinia-pedestal narrows the surface of pedestal. The power is already there waiting for me when I need (and learn), meanwhile lacinia-pedestal knows better than me.

👍 4