hasura / go-graphql-client

Package graphql provides a GraphQL client implementation.
MIT License
405 stars 94 forks source link

fix subscription hanging on error and add a stop subscription option inside the callback #39

Closed hgiasac closed 2 years ago

hgiasac commented 2 years ago
subscriptionId, err := client.Subscribe(&query, nil, func(dataValue *json.RawMessage, errValue error) error {
    // ...
    // return this error to stop the subscription in the callback
    return ErrSubscriptionStopped
})