The Guild · Example Payload

Schema Stitching Type Merging Example

Example of using @key and @merge stitching directives to configure type merging in SDL, enabling gateway-reloadable subservice config.

API CompositionAPI GatewayAPI ObservabilityBreaking Change DetectionCI/CDCode GenerationDeveloper ToolsExecutionFederationGitHub ActionsGraphQLJavaScriptMicroservicesMiddlewareMockingOpen-SourcePluginsRESTSDKScalarsSchemaSchema CompositionSchema MergingSchema RegistrySchema StitchingSchema TransformationSchema ValidationServerSubscriptionThe GuildType MergingType SafetyTypeScriptgRPC

Schema Stitching Type Merging Example is an example object payload from The Guild, with 9 top-level fields. It illustrates the shape of data this provider's APIs accept or return.

Top-level fields

titledescriptionlanguagepackagesubservice_1subservice_2gateway_result_typeinputoutput

Example Payload

Raw ↑
{
  "title": "Type Merging with Stitching Directives",
  "description": "Example of using @key and @merge stitching directives to configure type merging in SDL, enabling gateway-reloadable subservice config.",
  "language": "TypeScript",
  "package": "@graphql-tools/stitching-directives",
  "subservice_1": {
    "name": "Products Service",
    "sdl": "type Product @key(selectionSet: \"{ id }\") {\n  id: ID!\n  name: String!\n  price: Float!\n}\n\ntype Query {\n  product(id: ID!): Product @merge(keyField: \"id\", keyArg: \"id\")\n  products: [Product!]!\n}"
  },
  "subservice_2": {
    "name": "Inventory Service",
    "sdl": "type Product @key(selectionSet: \"{ id }\") {\n  id: ID!\n  stock: Int!\n  warehouse: String!\n}\n\ntype Query {\n  productInventory(id: ID!): Product @merge(keyField: \"id\", keyArg: \"id\")\n}"
  },
  "gateway_result_type": {
    "name": "Merged Product",
    "description": "The gateway automatically merges Product from both subservices",
    "fields": {
      "id": "ID! (from both)",
      "name": "String! (from Products Service)",
      "price": "Float! (from Products Service)",
      "stock": "Int! (from Inventory Service)",
      "warehouse": "String! (from Inventory Service)"
    }
  },
  "input": {
    "query": "{ products { id name price stock warehouse } }"
  },
  "output": {
    "data": {
      "products": [
        { "id": "p1", "name": "Widget Pro", "price": 29.99, "stock": 145, "warehouse": "US-EAST" },
        { "id": "p2", "name": "Gadget Plus", "price": 59.99, "stock": 0, "warehouse": "US-WEST" }
      ]
    }
  }
}

Work with this as data

Every example here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for examples

4 MCP tools reach this
  • find_examplesBrowse and filter every example in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools

Call it yourself

curl for this page
This example
curl "https://apis.io/api/v1/examples/schema-stitching-type-merging-example"
All examples
curl "https://apis.io/api/v1/examples?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no email required.

A second provider on the same verified email joins the account you already have.