Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
alanpeabody opened this issue Oct 26, 2020 · 0 comments

Comments

@alanpeabody
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant