Hey! I have attempted to get dataloader to work inside of my umbrella application. The dataloader works if I use the on_load macro rather than the dataloader macro. This is because for whatever reason the plugins is not getting hit to add the dataloader middleware which would run the dataloader before the resolution was completed.
These are the plugins that are not connecting…
def plugins do
[Absinthe.Middleware.Dataloader] ++ Absinthe.Plugin.defaults()
end
This is the code that needs to get called through the plugin
def before_resolution(%{context: context} = exec) do
context =
with %{loader: loader} <- context do
%{context | loader: Dataloader.run(loader)}
end
%{exec | context: context}
end