This repository was archived by the owner on Jul 25, 2024. It is now read-only.

Description
It's very important to know who the current user is when you resolve queries. It's pretty easy to assign this information to the conn using plugs before the GraphQL plug, like so:
plug :authenticate_user
plug GraphQL.Endpoint, ...
However, since the conn is not passed into the query execution function, the resolvers have no way to know who the current user is, and therefore authentication seems impossible.
I think the conn should be added as the third argument to this function:
https://github.com/joshprice/plug_graphql/blob/21e42b00cdd9d689f5f048859e66f253d1c8d3e7/lib/graphql/plug/endpoint.ex#L44
The core GraphQL Elixir library may need to be extended to pass the context to all the resolvers.
Am I missing something here?