feat: add Cosmo Router config generation and PubSub support
Creates a new `GenerateCosmoRouterConfig` function to build and serialize a Cosmo Router configuration from subgraphs. Implements PubSub mechanism for managing schema updates, allowing subscription to updates. Adds Subscription resolver and updates existing structures to accommodate new functionalities. This enhances the system's capabilities for dynamic updates and configuration management.
This commit is contained in:
@@ -49,6 +49,13 @@ type Organization struct {
|
||||
type Query struct {
|
||||
}
|
||||
|
||||
type SchemaUpdate struct {
|
||||
Ref string `json:"ref"`
|
||||
ID string `json:"id"`
|
||||
SubGraphs []*SubGraph `json:"subGraphs"`
|
||||
CosmoRouterConfig *string `json:"cosmoRouterConfig,omitempty"`
|
||||
}
|
||||
|
||||
type SubGraph struct {
|
||||
ID string `json:"id"`
|
||||
Service string `json:"service"`
|
||||
@@ -68,6 +75,9 @@ type SubGraphs struct {
|
||||
|
||||
func (SubGraphs) IsSupergraph() {}
|
||||
|
||||
type Subscription struct {
|
||||
}
|
||||
|
||||
type Unchanged struct {
|
||||
ID string `json:"id"`
|
||||
MinDelaySeconds int `json:"minDelaySeconds"`
|
||||
|
||||
Reference in New Issue
Block a user