ecthiender / py-graphql-client

Dead-simple GraphQL client with subscriptions over websockets
https://pypi.org/project/py-graphql-client/
Other
37 stars 11 forks source link

Fix first subscription message is lost (close #4) #3

Closed BharathaAravind closed 5 years ago

BharathaAravind commented 5 years ago

The _start was consuming the first reply from the server for both query and subscribe functions.

As per the GraphQL subscription spec, the GQL_START message gets a GQL_DATA message as a reply for both subscriptions and queries/mutations through websocket.

This change updates the _start and query method, where the _start no longer waits for the response and returns the _id and the first receive would be GQL_DATA for the query method.

BharathaAravind commented 5 years ago

I have added a commit with the changes. https://github.com/ecthiender/py-graphql-client/pull/3/commits/e486ccb616fb3286247dce50f14486a784e7444e