Documentation ¶
Index ¶
- Variables
- func AddHeader(ctx context.Context, key, value string) context.Context
- type Client
- type Gateway
- func (g *Gateway) Complexity(typeName, fieldName string, childComplexity int, args map[string]interface{}) (int, bool)
- func (g *Gateway) Exec(ctx context.Context) graphql.ResponseHandler
- func (g *Gateway) Execute(ctx context.Context) *graphql.Response
- func (g *Gateway) Schema() *ast.Schema
- func (g *Gateway) SetSchema(schema *Schema)
- func (g *Gateway) WithClient(client *Client) *Gateway
- func (g *Gateway) WithDebugExtensions(enabled bool) *Gateway
- func (g *Gateway) WithMaxRequests(maxRequests int64) *Gateway
- type Operation
- type Response
- type Schema
- func (s *Schema) HasField(location, typeName, field string) bool
- func (s *Schema) IsEntity(typeName string) bool
- func (s *Schema) IsKey(typeName string, field string) bool
- func (s *Schema) Key(typeName string) []string
- func (s *Schema) Requires(typeName string, field string) []string
- func (s *Schema) Route(parentType string, parentLocation string, input ast.SelectionSet) (map[string]ast.SelectionSet, error)
- type Service
- type Status
Constants ¶
This section is empty.
Variables ¶
var Prelude = &ast.Source{ Name: "federation.graphql", Input: federationGraphql, BuiltIn: true, }
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a GraphQL client.
func NewClient ¶
NewClient creates a new GraphQL client.
If hc is nil, http.DefaultClient will be used.
func (*Client) Execute ¶
Execute executes a GraphQL operation.
The data returned by the server will be decoded into the data argument.
func (*Client) WithUserAgent ¶
WithUserAgent sets the user agent used by the client.
type Gateway ¶
type Gateway struct {
// contains filtered or unexported fields
}
Gateway is a GraphQL federation gateway.
Gateway implements gqlgen/graphql.ExecutableSchema.
func (*Gateway) Complexity ¶
func (g *Gateway) Complexity(typeName, fieldName string, childComplexity int, args map[string]interface{}) (int, bool)
Complexity returns the query complexity (unimplemented)
func (*Gateway) Exec ¶
func (g *Gateway) Exec(ctx context.Context) graphql.ResponseHandler
Exec returns the execution handler.
func (*Gateway) SetSchema ¶
SetSchema sets the federated schema used by the gateway.
SetSchema is safe for concurrent use by multiple goroutines.
func (*Gateway) WithClient ¶
WithClient configures the client used for downstream GraphQL operations.
func (*Gateway) WithDebugExtensions ¶
WithDebugExtensions configures debugging information for GraphQL requests.
If enabled, debug information will be added to the response extensions. The following information will be provided:
- plan: the query plan, including services and subqueries
- timings: the execution times for the query
func (*Gateway) WithMaxRequests ¶
WithMaxRequests configures the maximum number of requests to make per query.
type Operation ¶
type Operation struct { Name string `json:"operationName,omitempty"` Query string `json:"query"` Variables map[string]interface{} `json:"variables,omitempty"` Uploads map[string]graphql.Upload `json:"-"` }
Operation is a GraphQL operation.
type Schema ¶
Schema represents a federated GraphQL schema.
func BuildSchema ¶
BuildSchema builds and returns a new federated GraphQL schema.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is a downstream GraphQL service.
func NewService ¶
NewService creates a new downstream service.