Documentation ¶
Index ¶
- Constants
- func ConfigJson(config Configuration) json.RawMessage
- type Batch
- type BatchFactory
- type Configuration
- type Factory
- type FederationConfiguration
- type FetchConfiguration
- type GraphQLBody
- type GraphQLSubscriptionClient
- type GraphQLSubscriptionOptions
- type Options
- type Planner
- func (p *Planner) ConfigureFetch() plan.FetchConfiguration
- func (p *Planner) ConfigureSubscription() plan.SubscriptionConfiguration
- func (p *Planner) DataSourcePlanningBehavior() plan.DataSourcePlanningBehavior
- func (p *Planner) DownstreamResponseFieldAlias(downstreamFieldRef int) (alias string, exists bool)
- func (p *Planner) EnterArgument(ref int)
- func (p *Planner) EnterDirective(ref int)
- func (p *Planner) EnterDocument(operation, definition *ast.Document)
- func (p *Planner) EnterField(ref int)
- func (p *Planner) EnterInlineFragment(ref int)
- func (p *Planner) EnterOperationDefinition(ref int)
- func (p *Planner) EnterSelectionSet(ref int)
- func (p *Planner) EnterVariableDefinition(ref int)
- func (p *Planner) LeaveDocument(operation, definition *ast.Document)
- func (p *Planner) LeaveField(ref int)
- func (p *Planner) LeaveInlineFragment(_ int)
- func (p *Planner) LeaveOperationDefinition(ref int)
- func (p *Planner) LeaveSelectionSet(ref int)
- func (p *Planner) LeaveVariableDefinition(_ int)
- func (p *Planner) Register(visitor *plan.Visitor, configuration plan.DataSourceConfiguration, ...) error
- type Source
- type SubscriptionConfiguration
- type SubscriptionSource
- type WebSocketGraphQLSubscriptionClient
Constants ¶
View Source
const ( MessageTypeConnectionAck = "connection_ack" MessageTypeConnectionError = "connection_error" MessageTypeConnectionKeepAlive = "ka" MessageTypeData = "data" MessageTypeError = "error" MessageTypeComplete = "complete" )
Variables ¶
This section is empty.
Functions ¶
func ConfigJson ¶
func ConfigJson(config Configuration) json.RawMessage
Types ¶
type Batch ¶
type Batch struct {
// contains filtered or unexported fields
}
func (*Batch) Demultiplex ¶
func (*Batch) Input ¶
func (b *Batch) Input() *fastbuffer.FastBuffer
type BatchFactory ¶
type BatchFactory struct{}
func NewBatchFactory ¶
func NewBatchFactory() *BatchFactory
func (*BatchFactory) CreateBatch ¶
func (b *BatchFactory) CreateBatch(inputs [][]byte) (resolve.DataSourceBatch, error)
type Configuration ¶
type Configuration struct { Fetch FetchConfiguration Subscription SubscriptionConfiguration Federation FederationConfiguration UpstreamSchema string }
func (*Configuration) ApplyDefaults ¶
func (c *Configuration) ApplyDefaults()
type Factory ¶
type Factory struct { BatchFactory resolve.DataSourceBatchFactory HTTPClient *http.Client // contains filtered or unexported fields }
type FederationConfiguration ¶
type FetchConfiguration ¶
type GraphQLBody ¶
type GraphQLBody struct { Query string `json:"query,omitempty"` OperationName string `json:"operationName,omitempty"` Variables json.RawMessage `json:"variables,omitempty"` }
type GraphQLSubscriptionClient ¶
type GraphQLSubscriptionClient interface {
Subscribe(ctx context.Context, options GraphQLSubscriptionOptions, next chan<- []byte) error
}
type GraphQLSubscriptionOptions ¶
type GraphQLSubscriptionOptions struct { URL string `json:"url"` Body GraphQLBody `json:"body"` Header http.Header `json:"header"` }
type Options ¶
type Options func(options *opts)
func WithLogger ¶
func WithLogger(log abstractlogger.Logger) Options
func WithReadTimeout ¶
type Planner ¶
type Planner struct {
// contains filtered or unexported fields
}
func (*Planner) ConfigureFetch ¶
func (p *Planner) ConfigureFetch() plan.FetchConfiguration
func (*Planner) ConfigureSubscription ¶
func (p *Planner) ConfigureSubscription() plan.SubscriptionConfiguration
func (*Planner) DataSourcePlanningBehavior ¶
func (p *Planner) DataSourcePlanningBehavior() plan.DataSourcePlanningBehavior
func (*Planner) DownstreamResponseFieldAlias ¶
func (*Planner) EnterArgument ¶
func (*Planner) EnterDirective ¶
func (*Planner) EnterDocument ¶
func (*Planner) EnterField ¶
func (*Planner) EnterInlineFragment ¶
func (*Planner) EnterOperationDefinition ¶
func (*Planner) EnterSelectionSet ¶
func (*Planner) EnterVariableDefinition ¶
func (*Planner) LeaveDocument ¶
func (*Planner) LeaveField ¶
func (*Planner) LeaveInlineFragment ¶
func (*Planner) LeaveOperationDefinition ¶
func (*Planner) LeaveSelectionSet ¶
func (*Planner) LeaveVariableDefinition ¶
type SubscriptionConfiguration ¶
type SubscriptionConfiguration struct {
URL string
}
type SubscriptionSource ¶
type SubscriptionSource struct {
// contains filtered or unexported fields
}
type WebSocketGraphQLSubscriptionClient ¶
type WebSocketGraphQLSubscriptionClient struct {
// contains filtered or unexported fields
}
WebSocketGraphQLSubscriptionClient is a WebSocket client that allows running multiple subscriptions via the same WebSocket Connection It takes care of de-duplicating WebSocket connections to the same origin under certain circumstances If Hash(URL,Body,Headers) result in the same result, an existing WS connection is re-used
func (*WebSocketGraphQLSubscriptionClient) Subscribe ¶
func (c *WebSocketGraphQLSubscriptionClient) Subscribe(ctx context.Context, options GraphQLSubscriptionOptions, next chan<- []byte) error
Subscribe initiates a new GraphQL Subscription with the origin Each WebSocket (WS) to an origin is uniquely identified by the Hash(URL,Headers,Body) If an existing WS with the same ID (Hash) exists, it is being re-used If no connection exists, the client initiates a new one and sends the "init" and "connection ack" messages
Click to show internal directories.
Click to hide internal directories.