Giter Club home page Giter Club logo

Comments (10)

saturn4er avatar saturn4er commented on May 28, 2024

Hi @gedw99, the problem is that GraphQL doesn't support subscriptions natively (they work like a query/mutation).

from proto2gql.

 avatar commented on May 28, 2024

so for example you could use a query to poll into and get a response. Performance would of course not scale. But is that what you mean.. ?

from proto2gql.

saturn4er avatar saturn4er commented on May 28, 2024

Can you, please, share some example of how this should work?

from proto2gql.

 avatar commented on May 28, 2024

Sorry but there are a ton examples.

Google for the 3 architectural solutions.

Polling

SSE - server side events

WS - web sockets.

from proto2gql.

saturn4er avatar saturn4er commented on May 28, 2024

As you can find, proto2gql generates only the schema and doesn't care about how it will be executed. So, what proto2gql should generate, to make it possible to handle streams?

from proto2gql.

 avatar commented on May 28, 2024

web socket, or grpc-web

from proto2gql.

saturn4er avatar saturn4er commented on May 28, 2024

Hey @gedw99, currently I`m working on the next iteration of the generator which will be able to generate full-featured GraphQL API Gateway and there the subscriptions could be included. Please let me know and I will update you as soon as I finish.

from proto2gql.

 avatar commented on May 28, 2024

hey @saturn4er sounds pretty nice.

your should not reinvent the wheel. Look at: https://github.com/z0mbie42/goes/tree/master/_examples/api

Because it is a event source base it makes it much easier to support subscriptions.
But you need either NATS or a DB to store which client gets the update pushed out and who already has it. Know what i mean ?
Many people use NATS embedded as it simplifies that trick concurrent aspect which is hard to get right.

Anyway if you have examples running i can help you ..

from proto2gql.

saturn4er avatar saturn4er commented on May 28, 2024

hey @gedw99, I don't really know what have you tried to make with this tool, and really don't understand what for do I need NATS or DB for subscription. I think it should work in such way:
When client try to execute GraphQL request with streams, our code calls GRPC method which returns channel. Than, as the server sends data, we receive it from channel and push it to client

from proto2gql.

 avatar commented on May 28, 2024

Ok i totally get what your saying, and thats pretty obvious stuff. I was just trying to explain how to use it with a event sourcing architecture. This is how you really built a Subscription based system using your current graphql / grpc architecture. You see for subscriptions you need a way to track what each user gets

from proto2gql.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.