Skip to content

Absinthe.Phoenix.Socket.put_options/2 overwrites options, causes loss of custom adapter.  #76

@alanpeabody

Description

@alanpeabody

Custom adapters & Absinthe.Phoenix.Channels do not work.

When using a custom adapter only the first request uses the adapter, subsequent request do not.

This happens due to the use of Absinthe.Phoenix.Socket.put_options/2 inside Absinthe.Phoenix.Channels.run_doc/4 - Absinthe.Phoenix.Socket.put_options/2 overwrites the entire :opts field.

Some simple solutions might be:

  1. Use Map.merge instead of Map.put in put_options.
  2. Manually preserve adapter as well as context in run_doc.
  3. Add a merge_options or similar.

Let me know the preferred approach and I can open a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions