Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrStopSubscription = errors.New("stop subscription")
ErrStopSubscription ends a subscription without an error when a handler returns it.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) Subscribe ¶ added in v1.5.0
func (c *Client) Subscribe(ctx context.Context, query string, variables map[string]interface{}, handle func(json.RawMessage) error) error
Subscribe runs a GraphQL subscription and calls handle with the data of each event. It returns nil when the server completes, ctx ends, or handle returns ErrStopSubscription. The client timeout applies to the handshake only.
type GraphQLError ¶
type GraphQLRequest ¶
type GraphQLResponse ¶
type GraphQLResponse struct {
Data json.RawMessage `json:"data"`
Errors []GraphQLError `json:"errors,omitempty"`
}
type Option ¶ added in v1.4.0
type Option func(*Client)
func WithDryRun ¶ added in v1.4.0
func WithTimeout ¶ added in v1.4.0
Click to show internal directories.
Click to hide internal directories.