Skip to content

feat: compose a subgraph from its sdl - #96

Merged
mcollina merged 1 commit into
platformatic:mainfrom
mikaelkaron:feat/subgraph-sdl
Oct 14, 2026
Merged

mcollina merged 1 commit into
platformatic:mainfrom
mikaelkaron:feat/subgraph-sdl

Conversation

@mikaelkaron

Copy link
Copy Markdown
Contributor

A subgraph can now provide its schema as SDL with the sdl option. When it does, the composer builds the subgraph introspection from the SDL instead of requesting the composeEndpoint or sending the introspection query to the graphqlEndpoint, so composing does not depend on the subgraph being reachable. Queries are still sent to server.host and server.graphqlEndpoint, and entities work as for a fetched schema.

The introspection is built with the options of the default introspection query, so a subgraph composed from its SDL gives the same supergraph as the same subgraph composed from its server. An SDL that can not be parsed or is not a valid schema is reported to onSubgraphError, as a schema that can not be fetched is.

Assisted-by: Claude Code:claude-opus-5-5

A subgraph can now provide its schema as SDL with the `sdl` option. When
it does, the composer builds the subgraph introspection from the SDL
instead of requesting the composeEndpoint or sending the introspection
query to the graphqlEndpoint, so composing does not depend on the
subgraph being reachable. Queries are still sent to `server.host` and
`server.graphqlEndpoint`, and entities work as for a fetched schema.

The introspection is built with the options of the default introspection
query, so a subgraph composed from its SDL gives the same supergraph as
the same subgraph composed from its server. An SDL that can not be
parsed or is not a valid schema is reported to onSubgraphError, as a
schema that can not be fetched is.

Signed-off-by: Mikael Karon <mikael@karon.se>
Assisted-by: Claude Code:claude-opus-5-5

@mcollina mcollina left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@mcollina
mcollina merged commit 484cb50 into platformatic:main Oct 14, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants