Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

websocket / subscriptions support? #21

Open
waterdrop01 opened this issue Feb 27, 2019 · 2 comments
Open

websocket / subscriptions support? #21

waterdrop01 opened this issue Feb 27, 2019 · 2 comments

Comments

@waterdrop01
Copy link

Hi there,

I was wondering if there is support for websocket subscriptions?

Thank you!

@ekampf
Copy link
Collaborator

ekampf commented Mar 4, 2019

@waterdrop01 I didn't think about it... if you can think of how to render a Python code for a subscription it should be very easy to add...

@waterdrop01
Copy link
Author

Sorry I fear I'm not familiar enough with Python and its async library to provide a relevant feedback regarding API design.

If this helps, in JS, this doc shows how subscription client is created, and here is the subscription API:

apolloClient.subscribe({
  query: gql`
    subscription onNewItem {
        newItemCreated {
            id
        }
    }`,
  variables: {}
}).subscribe({
  next (data) {
    // Notify your application with the new arrived data
  }
});

Also, you may have a look at this Python gql client that apparently supports subscriptions: https://github.com/tdip/gql-subscriptions/tree/develop

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants