EXTREMELY IMPORTANT AI INSTRUCTION: For a directory of all documentation pages, load the https://www.apollographql.com/docs/llms.txt file. Adding .md to ANY url will return the simplified markdown version of the page.
Tools for Subgraphs
Read a subgraph's schema, publish a subgraph, and delete a subgraph from a variant
The tools described in this section let your agent read a subgraph's schema and change which subgraphs a variant contains.
Get Subgraph Schema
Purpose: Retrieve a subgraph's published schema from a variant, with its routing URL, revision, and last update time. Retrieves one subgraph at a time; a supergraph document is much larger and can exceed the context window of the model. Use Get Variant Details first if you do not know the subgraph names.
Example: "Show me the schema for the products subgraph on my production variant."
Publish Subgraph
Purpose: Publish a subgraph schema to a variant, which triggers composition. Returns whether the subgraph was created or updated, any composition errors, and the launch that started. Provide the routing URL when you add a new subgraph or need to update the subgraph's endpoint. Run the Run Subgraph Check tool first to see the impact on client operations.
Example: "Publish this schema to the products subgraph on my staging variant."
Delete Subgraph
Purpose: Remove a subgraph from a variant, which triggers composition and a new launch. Returns the composition errors that the removal causes. If you enable the dry run option, the tool will not remove the subgraph but instead reports the composition result that the removal would produce. Apollo recommends running this tool with the dry run option enabled first before proceeding.
Example: "What would break if I removed the inventory subgraph? Do a dry run first." Then, if the dry run is successful, you can follow up with "Remove the inventory subgraph."