Absinthe.GraphqlWS.Util.assign_context

You're seeing just the function assign_context, go back to Absinthe.GraphqlWS.Util module for more information.
Link to this function

assign_context(socket, context)

View Source

Adds key-value pairs into Absinthe context. This can be used in the Absinthe.GraphqlWS.Socket.handle_init/2 to assign keys/values to the current Absinthe context.

Examples

defmodule MySocket do
  use Absinthe.GraphqlWS.Socket, schema: MySchema

  def handle_init(%{"user_id" => user_id}) do
    user = find_user(user_id)
    socket = assign_context(socket, current_user: user)
    %{:reply, :ok, {:text, Absinthe.GraphqlWS.Message.ConnectionAck.new()}, socket}
  end
end
Link to this function

assign_context(socket, key, value)

View Source

Same as assign_context/2 except one key-value pair is assigned.