Wagtail Grapples and WebSocket #347
Replies: 5 comments 5 replies
-
Small additional details. I'm creating a project, for the backend one of the options was Django + Graphene, but I decided to use Wagtail 5 and Grapple in order to create a GraphQL API. Front uses Quasar + Apollo. I have the functionality of various pages, including the user profile. And the functionality of a simple infinite canvas is created, on which the work of several users will be possible. I guess I need to use WebSocket for this. I'm trying to figure out how I can implement this on the side of the Wagtail 5 backend without wasting time. So far, I have not quite understood how you can use Wagtail Grapple to implement WebSocket? If this is not possible, then I ask you to suggest what alternative solutions can be? |
Beta Was this translation helpful? Give feedback.
-
Can Wagtail Grapple work with Django Channels in the same way that Graphene does? I'm just a little confused by this information:
I don't get it, does the fact that I'm using Wagtail Grapple mean that I can use the full power of Graphene / Graphene Django through Wagtail Grapple? 😺 |
Beta Was this translation helpful? Give feedback.
-
Prior to v0.20, we had support for websockets via graphql-ws. However that is currently unmaintained and incompatible with more recent versions of Graphene/ Graphene Django. You could have a look at #336 to get an idea of what it was doing. And add your own implementation via the Subscription hook - https://wagtail-grapple.readthedocs.io/en/latest/general-usage/hooks.html#subscription.
Grapple provides the necessary abstractions for Wagtail-related code, but the hooks system should allow you to extend that to make more use of Graphene/Graphene Django (say via custom schema or mutations) |
Beta Was this translation helpful? Give feedback.
-
I'm still not good at this and would not like to be a person who just "pokes a finger in the sky", but perhaps there are libraries that you could / would like to integrate with Wagtail Grapple to get a full and convenient WebSocket functionality? :-) Does this look like something suitable or is it something else and is not able to replace graphql-ws? |
Beta Was this translation helpful? Give feedback.
-
To make my question clearer, perhaps I should phrase it like this: Based on the assumption that DjangoChannelsGraphqlWs is currently the best solution for implementing WebSocket functionality, in this case, is there any clear mechanism, how can Wagtail Grapple be used to conveniently, quickly and reliably define GraphQL types and schemas, so that through DjangoChannelsGraphqlWs add support for GraphQL subscriptions via WebSocket, so that it would not be necessary to define types and schemas using Graphene Django in a more complicated way? |
Beta Was this translation helpful? Give feedback.
-
Hello, unfortunately I could not figure it out myself, so I ask you to give me an explanation on my question :-)
The description says:
Do I understand correctly that when using Wagtail Grapple, I can implement the ability from my front to work with the Wagtail backend via WebSocket?
Or do I need something else for this and Wagtail Grapple will not work for this?
Beta Was this translation helpful? Give feedback.
All reactions