Comments (6)
I'd also be very interested in subscription support! Going to need it one way or the other :D
from sgqlc.
Not yet, @netogallo seems to be working on it, as per #23.
I'm busy with some work-related stuff, but as soon as things calm down I'd like to implement that on top of aiohttp
, also adding the async endpoint.
from sgqlc.
I just published a python GraphQL client library supporting subscriptions over websocket. Check it out here. Contributions and comments are most welcome.
from sgqlc.
The referenced PR implements a synchronous websocket endpoint that returns all the data objects after completion. Async may make more sense for some, but this fits our use case at the moment.
from sgqlc.
hi all, the PR #55 is great and about to be merged, but I have a question to users (asked there, but you can also answer here):
Is it better to accumulate a list during the whole session, until completed
message arrives? Or should we progressively yield result
as each message is processed? In my mind the yield
would be required by subscription
usage, since you're progressively receiving more data you want to process immediately, not at the end.
On a related question: should we create the websocket internally and execute one single query as it's implemented in #55, or should we create it in 2 phases:
- WebSocket wrapper: connects, does the
id
generation and dispatching of messages ("observer") - WebSocket endpoint, that takes the wrapper above and issue one single query by queueing it to the wrapper, then when the replies arrive it will yield the results to each endpoint.
This would not be required for "app with one subscription" (as it would be the same), but if we do have multiple subscriptions, or want to interleave multiple queries/mutations/subscriptions in the same channel (saving the connection time for each), it would be required.
Move to yield
is reasonably simpler... but to interleave multiple operations would be more work.
from sgqlc.
merged with single query support. We can extend it to support multi query later.
from sgqlc.
Related Issues (20)
- HTTP endpoint class should not include Authorization headers in __str__ method HOT 3
- HTTP endpoint class should allow compression of the data using gzip HOT 1
- Code Completion In Pycharm HOT 7
- Nested jsonb in insert mutation HOT 6
- Fragment Operation with inline and nested fragments "Unknown fragments..." error HOT 4
- Enums should be nullable on input HOT 1
- Issues with operation generator HOT 3
- Best practice to construct nested query variables
- 'utf-8' codec can't decode byte 0x8b in position 1: invalid start byte HOT 1
- Nested Nodes aren't being appended to the Query HOT 4
- Add support for `UUID` Type HOT 3
- Connections in requests session are closed after each request HOT 2
- Way to add new properties to object types and print with __to_json_value__() HOT 3
- python -m sgqlc.introspection is failing with apollo/server": "^4.3.2 HOT 1
- Operation output graphql-core compatible Document AST HOT 8
- Operation codegen does not find variables with DataHub graphql code HOT 3
- Add support for the GraphQL-WS Subprotocol
- There is no documentation on how to use __json_dump_args__ ? HOT 4
- Supporting a few schemas HOT 1
- Failed tests in sgqlc/types/__init__.py and sgqlc/operation/__init__.py
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 sgqlc.