Comments (10)
Hi @gedw99, the problem is that GraphQL doesn't support subscriptions natively (they work like a query/mutation).
from proto2gql.
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.
Can you, please, share some example of how this should work?
from proto2gql.
Sorry but there are a ton examples.
Google for the 3 architectural solutions.
Polling
SSE - server side events
WS - web sockets.
from proto2gql.
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.
web socket, or grpc-web
from proto2gql.
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.
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.
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.
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from proto2gql.