gql-next
gql-next copied to clipboard
websocket / subscriptions support?
Hi there,
I was wondering if there is support for websocket subscriptions?
Thank you!
@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...
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