I’m preparing a graphQL API and need to maintain different :max_complexity on a per user basis.
Since I am not using Absinthe.run/3 but :absinthe_plug which only supports a global maximum as I read the documentation, I’m wondering if I can set the max in a different way in a plug via the context (or whatever).
I’m already preparing a plug which does authentication for graphql, so I could extend on that if we can communicate the appropriate value of :max_complexity to absinthe or do I need to throw away absinthe_plug and do it completely manually?
case user do
%User{admin?: true} -> Absinthe.Plug.put_options(conn, max_complexity: 100)
_user -> Absinthe.Plug.put_options(conn, max_complexity: 50)
end