Graphql-laravel: Is there any way to use with Apollo client subscriptions?

Created on 2 Aug 2019  Â·  17Comments  Â·  Source: rebing/graphql-laravel

I am building a POS screen, in which data needs real time continuously. Currently I am using a Laravel-echo-server socket server.
But the data pushing us from the socket cannot be updated to the apollo's cache because it is not standardized. So is there any solution or not?

enhancement help wanted

Most helpful comment

I have actually cooked something up that works, but definitely a proof of concept.

I have minimum experience with subscriptions/websockets so will definitely need some input to make it generally usable.

I will try to clean it up a bit and throw it up here so other people can play around with.

Give me a few weeks.

All 17 comments

We have a running version of rebing/graphql-laravel pushing to a Node.js subscription server, which works well, but just feels wrong.

We're currently working on a PHP implementation and already have a running Proof of Concept, but it'll still need a lot of work/time.

Perhaps with Server-Sent Events (SSE) or Laravel Websockets could be implemented. Maybe someone brave could try :)

Symfony Mercure

Maybe it could be achieved using this.

The most important is have to a standard response GraphQL data (dependency of the query) to automatically update apollo client cache.
That can only be achieved from this library

oh, I have the same problem, I can't update the cache Apollo client

That's actually the main reason I'm eyeing Lighthouse right now, because that has it already built in.
Is this planned in some way? If not, it would be good to know.

Hi,

I'm not aware of any plans.

I'm closing this as I don't see traction of someone to work on this and PRs / features are always welcome, no matter if they've an issue or not.

I have actually cooked something up that works, but definitely a proof of concept.

I have minimum experience with subscriptions/websockets so will definitely need some input to make it generally usable.

I will try to clean it up a bit and throw it up here so other people can play around with.

Give me a few weeks.

Hi @crissi do you have something to share about it? Just to have an entry point.
Thanks!

I see that I did not really keep what I promised. Never actually got to use it at work so it kind of faded out of mind. Will try to get it up ASAP, taking a look at it now

Thank you very much, also for the angular part, it was just what I was looking for.
I write to you if I can work out something structured or if I have thoughts to discuss.
I know that this implementation is already present in nuwave/lighthouse but I wanted to try without "the road being too delineated".

I am reading several articles about it, I was wondering what you think about the _server sent event (SSE)_ which at first glance seemed more simple and suitable for this type of communication.
In fact, I don't understand why to "bother" the websockets for a purely server to client communication.
I found this @deprecate WebSockets: GraphQL Subscriptions using SSE article very interesting which also highlights some limitations, plus I see a feature request apollographql/apollo-feature-requests#135.

I did look into that, but since the implemenation I was building for was all using websockets, graphql-playground and Apollo angular, I choose that. But yes seems to be the right choice for the feature, just need better support

Hent Outlook til iOShttps://aka.ms/o0ukef


Fra: Andrea Lambicchi notifications@github.com
Sendt: Tuesday, December 1, 2020 12:04:48 AM
Til: rebing/graphql-laravel graphql-laravel@noreply.github.com
Cc: Christian c2n@live.dk; Mention mention@noreply.github.com
Emne: Re: [rebing/graphql-laravel] Is there any way to use with Apollo client subscriptions? (#438)

I am reading several articles about it, I was wondering what you think about the server sent event (SSE) which at first glance seemed more simple and suitable for this type of communication.
In fact, I don't understand why to "bother" the websockets for a purely server to client communication.
I found this @deprecate WebSockets: GraphQL Subscriptions using SSEhttps://wundergraph.com/blog/deprecate_graphql_subscriptions_over_websockets article very interesting which also highlights some limitations, plus I see a feature request apollographql/apollo-feature-requests#135https://github.com/apollographql/apollo-feature-requests/issues/135.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com/rebing/graphql-laravel/issues/438#issuecomment-736108338, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAXPDYWV2X4WYXVSN3S7SLLSSQQJBANCNFSM4II4HYLA.

Very useful info. Thanks for the example.

I found this: https://github.com/mvanduijker/laravel-mercure-broadcaster maybe it could be plugged to graphql-laravel

Good! Thanks, I take it into consideration.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

stevelacey picture stevelacey  Â·  8Comments

edgarsn picture edgarsn  Â·  4Comments

nozols picture nozols  Â·  8Comments

dongkaipo picture dongkaipo  Â·  4Comments

mikev032 picture mikev032  Â·  4Comments