ThirVondukr / aioinject

Async-first python dependency injection library
https://thirvondukr.github.io/aioinject/
MIT License
27 stars 2 forks source link

Support for subscriptions in strawberry. #16

Open nrbnlulu opened 2 months ago

nrbnlulu commented 2 months ago

Warning: do not merge

This pr adds test for when extensions on subscriptions are supported in strawberry upstream.

ThirVondukr commented 2 months ago

Looks good so far, by the way generally with things such as websockets and subscriptions (anything longer lived than a single request) it would be better to use DI system directly to avoid hanging onto resources such as db connections.

nrbnlulu commented 2 months ago

Looks good so far, by the way generally with things such as websockets and subscriptions (anything longer lived than a single request) it would be better to use DI system directly to avoid hanging onto resources such as db connections.

Can be kinda anoying if your subscription returns a Node for example. Because it can be resolved to so many types. therefor you'd be finding yourself using the DI system manually all over the place.