strawberry-graphql / strawberry

A GraphQL library for Python that leverages type annotations 🍓
https://strawberry.rocks
MIT License
3.87k stars 511 forks source link

Sanic implementation with Websockets? #1441

Open cnicodeme opened 2 years ago

cnicodeme commented 2 years ago

Hi!

I'm starting to set up Strawberry with Sanic, and followed the documentation on https://strawberry.rocks/docs/integrations/sanic, but when I try to use Apollo with Subscriptions, it fails to connect to my endpoint using websockets.

Sanic is a ASGI framework, so it works great with Websockets, but it seems that the current implementation of Sanic on Strawberry is not compatible with websockets. Is there a way to enable this?

Thank you in advance.

Upvote & Fund

Fund with Polar

patrick91 commented 2 years ago

Hi @cnicodeme! We don't support subscription with sanic just yet :) I think it should be easy to add support since we do support it for ASGI already, would you be able to try that? ^^

cnicodeme commented 2 years ago

@patrick91 Unfortunately I lack the knowledge to implement this and the time too :/

aryaniyaps commented 2 years ago

@patrick91 I could make a PR on this!

patrick91 commented 2 years ago

@aryaniyaps sure! that'd be awesome!