torchbox / wagtail-grapple

A Wagtail app that makes building GraphQL endpoints a breeze!

Home Page:https://wagtail-grapple.readthedocs.io/en/latest/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Wagtail Grapples and WebSocket

VladimirLevadnij opened this issue · comments

Hello, unfortunately I could not figure it out myself, so I ask you to give me an explanation on my question :-)

The description says:

This library is an abstraction upon and relies heavily on Graphene & Graphene Django.

Graphene
Graphene Django

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?

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?

Can Wagtail Grapple work with Django Channels in the same way that Graphene does?

I'm just a little confused by this information:

This library is an abstraction upon and relies heavily on Graphene & Graphene Django.

Graphene
Graphene Django

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? 😺

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.

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? 😺

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)