Documentation
¶
Overview ¶
Package composition implements federation composition for GraphQL.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildRouterConfiguration ¶
BuildRouterConfiguration produces a federated router configuration as a string that can be saved to a file and used to configure the router data sources.
Types ¶
type FederatedGraph ¶
type FederatedGraph struct {
FieldConfigurations []*FieldConfiguration `goja:"fieldConfigurations"`
SDL string `goja:"sdl"`
}
func Federate ¶
func Federate(subgraphs ...*Subgraph) (*FederatedGraph, error)
Federate produces a federated graphs from the schemas and names of each of the subgraphs.
type FieldConfiguration ¶
type Subgraph ¶
type Subgraph struct {
// Name is the name of the subgraph
Name string `goja:"name"`
// URL is the URL of the subgraph used for sending operations
URL string `goja:"url"`
// Schema is the SDL of the subgraph as a string. If empty, the schema
// is retrieved from the URL using the _service query.
Schema string `goja:"schema"`
SubscriptionURL string `goja:"subscription_url"`
SubscriptionProtocol string `goja:"subscription_protocol"`
}
Subgraph represents a graph to be federated. URL is optional.
Click to show internal directories.
Click to hide internal directories.