{"id":13567093,"url":"https://github.com/stubailo/schema-stitching-demo","last_synced_at":"2026-02-15T20:07:21.261Z","repository":{"id":139512137,"uuid":"102034832","full_name":"stubailo/schema-stitching-demo","owner":"stubailo","description":"Example of schema stitching with graphql-tools","archived":false,"fork":false,"pushed_at":"2018-03-31T23:59:05.000Z","size":30,"stargazers_count":154,"open_issues_count":3,"forks_count":25,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-11-04T21:37:20.410Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.apollographql.com/docs/graphql-tools/schema-stitching.html","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stubailo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-08-31T19:00:15.000Z","updated_at":"2024-06-15T22:21:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"4bbff9e6-e0c3-4e7c-b624-e12f82e4777f","html_url":"https://github.com/stubailo/schema-stitching-demo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stubailo%2Fschema-stitching-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stubailo%2Fschema-stitching-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stubailo%2Fschema-stitching-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stubailo%2Fschema-stitching-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stubailo","download_url":"https://codeload.github.com/stubailo/schema-stitching-demo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247107816,"owners_count":20884793,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T13:02:23.430Z","updated_at":"2026-02-15T20:07:21.232Z","avatar_url":"https://github.com/stubailo.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# Schema stitching demo\n\nSchema stitching is the idea of automatically combining two or more GraphQL schemas into one. It can be used to modularize a single GraphQL codebase, integrate with other APIs, or just combine two public APIs into one. This is going to be one of the main features of the 2.0 release of [graphql-tools](https://github.com/apollographql/graphql-tools/pull/382), a library for creating and manipulating GraphQL schemas in JavaScript.\n\nHuge thanks to [Mikhail Novikov](https://github.com/freiksenet) for his awesome design and implementation on this feature, and please contribute to the PR if you find it exciting!\n\n### Running the example\n\nJust run it like any other npm project:\n\n```\nnpm install\nnpm start\n```\n\nThen, open [localhost:3000/graphiql](http://localhost:3000/graphiql) in your web browser, and hit run on the query!\n\nOh and also grab a ticket for [GraphQL Summit 2017](https://summit.graphql.com/), a 2-day GraphQL conference in San Francisco on October 25-26.\n\n### What does this do?\n\nFor all of the details, read the upcoming blog post (TODO).\n\nIn short, this combines two GraphQL APIs:\n\n1. The [public GraphQL API](https://developers.universe.com/page/graphql-explorer) of Universe, the ticketing system we're using for GraphQL Summit\n2. The [Dark Sky weather API wrapped in GraphQL on Launchpad](https://launchpad.graphql.com/5rrx10z19), built by [Matt Dionis](https://github.com/Matt-Dionis)\n\nAgainst those two APIs, we can run the following queries:\n\n```graphql\n# Get information about GraphQL Summit from Universe\nquery {\n  event(id: \"5983706debf3140039d1e8b4\") {\n    title\n    venueName\n    address\n    cityName\n  }\n}\n\n# Get weather information about San Francisco from Dark Sky\nquery {\n  location(place: \"San Francisco\") {\n    city\n    country\n    weather {\n      summary\n      temperature\n    }\n  }\n}\n```\n\nOne thing that stands out is that the `cityName` field from Universe matches up nicely with the argument to the `location` field in the Dark Sky API. So what if we could just nicely pipe one into the other? Well, with schema stitching in graphql-tools 2.0, we now can!\n\n```ts\nconst schema = mergeSchemas({\n  schemas: [universeSchema, weatherSchema],\n  links: [\n    {\n      name: 'location',\n      from: 'Event',\n      to: 'location',\n      resolveArgs: parent =\u003e ({ place: parent.cityName }),\n      fragment: `\n        fragment WeatherLocationArgs on Event {\n          cityName\n        }\n      `,\n    },\n  ],\n});\n```\n\nThis is saying that we want to add a `location` field on the `Event` type, and to call it we need the `cityName` field. Then, it just maps that field onto the `place` argument on the location field. Now, we can run the following query that gets information from both APIs!\n\n```graphql\nquery {\n  # From the Universe API\n  event(id: \"5983706debf3140039d1e8b4\") {\n    title\n    description\n    url\n\n    # Stitched field that goes to the Dark Sky API\n    location {\n      city\n      country\n      weather {\n        summary\n        temperature\n      }\n    }\n  }\n}\n```\n\nThis is a pretty basic example, and we're still working on the complete documentation. Follow along with the discussion on the [graphql-tools PR](https://github.com/apollographql/graphql-tools/pull/382)!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstubailo%2Fschema-stitching-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstubailo%2Fschema-stitching-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstubailo%2Fschema-stitching-demo/lists"}