Fork me on GitHub
#graphql
<
2018-04-07
>
shivekkhurana09:04:30

[Lacinia Question] : Is it possible to pass custom data to application context (`ctx`) when the schema is being compiled ? I want to make a log function available to every resolver via ctx.

hlship18:04:13

Actually, you provide an initial context (possibly nil) when you invoke execute. Lacinia will add additional keys it needs to the context, but otherwise it passes through. This is one way to pass such dependencies around.

malcolmsparks11:04:06

@shivekkhurana yes, you can pass anything you like in the application context -that's its purpose

💯 4