Giter Site home page Giter Site logo

Comments (6)

metachris avatar metachris commented on August 27, 2024 2

I'd also be very interested in subscription support! Going to need it one way or the other :D

from sgqlc.

barbieri avatar barbieri commented on August 27, 2024

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.

ecthiender avatar ecthiender commented on August 27, 2024

I just published a python GraphQL client library supporting subscriptions over websocket. Check it out here. Contributions and comments are most welcome.

pip package
Source

from sgqlc.

josephlbarnett avatar josephlbarnett commented on August 27, 2024

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.

barbieri avatar barbieri commented on August 27, 2024

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.

barbieri avatar barbieri commented on August 27, 2024

merged with single query support. We can extend it to support multi query later.

from sgqlc.

Related Issues (20)

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.