Absinthe.Phoenix.Socket.put_options
You're seeing just the function
put_options
, go back to Absinthe.Phoenix.Socket module for more information.
Specs
put_options(Phoenix.Socket.t(), Absinthe.run_opts()) :: Phoenix.Socket.t()
Configure Absinthe options for a socket.
Examples
def connect(params, socket) do
current_user = current_user(params)
socket = Absinthe.Phoenix.Socket.put_options(socket, context: %{
current_user: current_user
})
{:ok, socket}
end
defp current_user(%{"user_id" => id}) do
MyApp.Repo.get(User, id)
end