Skip to content

Commit 6a8dda3

Browse files
authored
chore: Revert supergraph.yaml (#6402)
1 parent da52b58 commit 6a8dda3

2 files changed

Lines changed: 42 additions & 6 deletions

File tree

configs/graphql/README.md

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ We use [The Guild's Hive Gateway](https://the-guild.dev/graphql/hive/docs/gatewa
99
## Files
1010

1111
- `gateway.config.ts`: Hive Gateway configuration (host, port, subgraph endpoints, metrics)
12-
- `supergraph.yaml`: Rover CLI configuration for composing subgraphs
12+
- `supergraph.yaml`: **Rover CLI configuration** for composing multiple subgraph schemas into a unified supergraph schema
1313
- `router.yaml`: Legacy Apollo Router configuration (kept for reference)
1414

1515
## Gateway Configuration
@@ -36,18 +36,27 @@ The federated graph consists of two subgraphs:
3636

3737
## Schema Updates
3838

39-
Hive Gateway loads the composed supergraph schema from `docs/manager/graphql-reference/supergraph.graphql`.
39+
### Supergraph Composition with Rover
4040

41-
When subgraph schemas are modified, regenerate the supergraph using Rover (Apollo Federation CLI):
41+
Hive Gateway loads the composed supergraph schema from `docs/manager/graphql-reference/supergraph.graphql`. This unified schema is generated by composing multiple subgraph schemas using **Rover**, the Apollo Federation CLI tool.
42+
43+
The `supergraph.yaml` file is the Rover configuration that defines:
44+
- **Subgraph names**: Identifiers for each subgraph (`graphene`, `strawberry`)
45+
- **Routing URLs**: HTTP endpoints for each subgraph service
46+
- **Schema file locations**: Local paths to each subgraph's GraphQL schema
47+
48+
When subgraph schemas are modified, regenerate the supergraph using Rover:
4249

4350
```bash
4451
# From project root
4552
rover supergraph compose --config configs/graphql/supergraph.yaml > docs/manager/graphql-reference/supergraph.graphql
4653
```
4754

48-
The `supergraph.yaml` file defines:
49-
- Subgraph names and routing URLs
50-
- Schema file locations for each subgraph
55+
This command:
56+
1. Reads the subgraph configurations from `supergraph.yaml`
57+
2. Loads and validates each subgraph schema from the specified file paths
58+
3. Composes them into a unified federated supergraph schema
59+
4. Outputs the result to `docs/manager/graphql-reference/supergraph.graphql`
5160

5261
After regenerating the supergraph, restart the gateway container:
5362

configs/graphql/supergraph.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Rover Supergraph Composition Configuration
2+
#
3+
# This file is used by Apollo Rover CLI to compose multiple subgraph schemas
4+
# into a unified supergraph schema for GraphQL Federation.
5+
#
6+
# Usage:
7+
# rover supergraph compose --config configs/graphql/supergraph.yaml > docs/manager/graphql-reference/supergraph.graphql
8+
#
9+
# After regenerating the supergraph schema, restart the gateway:
10+
# docker compose -f docker-compose.halfstack-main.yml restart backendai-half-apollo-router
11+
#
12+
# For more information, see:
13+
# - configs/graphql/README.md
14+
# - https://www.apollographql.com/docs/rover/commands/supergraphs
15+
16+
subgraphs:
17+
# Legacy GraphQL API (Graphene-based)
18+
graphene:
19+
routing_url: http://host.docker.internal:8091/admin/gql
20+
schema:
21+
file: ../../docs/manager/graphql-reference/schema.graphql
22+
23+
# New GraphQL API (Strawberry-based) with WebSocket subscription support
24+
strawberry:
25+
routing_url: http://host.docker.internal:8091/admin/gql/strawberry
26+
schema:
27+
file: ../../docs/manager/graphql-reference/v2-schema.graphql

0 commit comments

Comments
 (0)