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

Overriding subscriptions message processing logic #162

Open
upcFrost opened this issue Jul 29, 2021 · 2 comments
Open

Overriding subscriptions message processing logic #162

upcFrost opened this issue Jul 29, 2021 · 2 comments

Comments

@upcFrost
Copy link

Hi,

I am wondering if it is possible to override the subscription _on_connection_init logic. Right now it only sends ACK completely ignoring the payload, which cuts off one of possible auth methods (connectionParams used by Apollo, Altair, and some other clients).

It is of course possible to do it manually by subclassing AIOHTTPSubscriptionHandler and manually assigning the websocket route to this subclass, but by doing this I feel I'm doing something wrong.

@abusi
Copy link
Contributor

abusi commented Jul 29, 2021

Hi @upcFrost I think you have the right idea on how I would have done it with the current implementation of ttftt-aiohttp.
To provide a bit of context:
_

In our minds, tartiflette-aiohttp project is a basic thing used to showcase how aiohttp and tartiflette could interact, but, for instance, it wasn't used at our company because our usecases were too specific and we have done this integration our own way. My point being that either you have a easy usecase and use tartiflette-aiohttp as is, or you need something more tailored and you do your own aiohttp integration.

_

In this specific case you mention, I'll be okay to review, merge and release a PR that add a way to specify a list of callbacks for the websocket event that would be called when theses events occured.
If you have the time and want to contribute, i'll be happy with it :D

@upcFrost
Copy link
Author

If you have the time and want to contribute, i'll be happy with it

Want - yes, time - that's another story 😅
But I think a simple parameter similar to engine, with an instance of the class that extends AIOHTTPSubscriptionHandler should do the trick.

Anyways, thanks, I think I'll try to make it work the way I described.

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

2 participants