-
-
Notifications
You must be signed in to change notification settings - Fork 107
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
Subscribing with a token #32
Comments
Hey Adam, thanks for the issue! That's a great point, I hadn't considered that use case. The reason that I had the But given this use case it seems that maybe that design isn't ideal. I'll go ahead and make the changes. It's an easy change, but unfortunately it will require me to do a major version bump. |
Hey Adam, I made the update, I think this show now support your use case nicely. Please let me know how it goes! I was rushing out the door a for my two week vacation so I think the code examples need to be updated a bit for the Subscription module docs. But my code example in examples/src/Subscription.elm is up-to-date and is confirmed working with Elixir/Absinthe 👍 |
Hey @akeating, I’m going to close this out, but please let me know if there’s anything else to discuss here! And of course there will be a lot to consider as we discussed in #43 as to whether the framework-specific communication should be delegated to a different package, but I’ll leave that discussion to a different issue. |
Thanks DIllon! |
Thank you for helping me improve the package, I very much appreciate your feedback Adam! |
I'm interested in the use-case of using token authentication on connect. That is, I login, obtain a token and add it to the
socketUrl
used to define the subscription:If I define the subscription in the
init
I'm tied to a static url. See also https://hexdocs.pm/phoenix/channels.html#tying-it-all-together in the section Using Token Authentication. However I have not yet been able to make that work. I think part of the reason is the coupling between my model andGraphqelm.Subscription
module, where in a few places, I am required to pass-in my full model.Ideally, I would only pass you back the
graphqlSubscriptionModel
.subscriptions
would then look like this:and the update:
This means I have flexibility to do something such as (where
CounterState
is one of my data types):Aside from the separation of concerns, I can then define a subscription dynamically. Interested in your thoughts. Let me know if I'm missing something really obvious! I can put up a pr if you like, but be sure to carefully review it :)
The text was updated successfully, but these errors were encountered: