Fork me on GitHub

[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.


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.


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

💯 4