• Stars
    star
    349
  • Rank 121,528 (Top 3 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created about 4 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Guided examples exploring GraphQL Tools v6+ Schema Stitching

Schema Stitching Handbook

Guided examples of GraphQL Stitching doing useful things. While this book focuses on GraphQL Tools (JavaScript) and its specific capabilities, many of these general schema stitching concepts apply to implementations across languages, see similar projects:

Table of Contents

Installation

From the root directory, run:

yarn install

Foundation

  • Combining local and remote schemas

    • Adding a locally-executable schema.
    • Adding a remote schema, fetched via introspection.
    • Adding a remote schema, fetched from a custom SDL service.
    • Avoiding schema conflicts using transforms.
    • Authorization headers.
    • Basic error handling.
  • Mutations & subscriptions

    • Adding a remote mutation service.
    • Adding a remote subscription service.
    • Adding a subscriber proxy.
  • Single-record type merging

    • Type merging using single-record queries.
    • Query/execution batching.
  • Array-batched type merging

    • Type merging using array queries.
    • Handling array errors.
    • Nullability & error remapping.
  • Merged types with multiple keys

    • Configuring multiple key entry points for a merged type.
  • Nullable merges

    • Selecting nullability for merged fields.
    • Returning nullable and not-nullable results.
  • Custom merge resolvers

    • Using valuesFromResults to normalize resulting query data.
    • Adapting type merging to query through namespaced scopes.
    • Adapting type merging to query through non-root fields.
    • Using batchDelegateToSchema and delegateToSchema.
  • Cross-service interfaces

    • Distributing a GraphQL interface across services.
  • Computed fields

    • Configuring computed fields.
    • Sending complex inputs to subservices.
    • Normalizing subservice deprecations in the gateway.
  • Stitching directives SDL

    • @key directive for type-level selection sets.
    • @merge directive for type merging services.
    • @computed directive for computed fields.
    • @canonical directive for preferred element definitions.

Architecture

  • Hot schema reloading

    • Hot reload of the combined gateway schema (no server restart).
    • Polling for remote subschema changes.
    • Mutations for adding/removing remote subservices.
    • Handling subservice request timeouts.
  • Versioning schema releases

    • Using GitHub API to manage a simple schema registry.
    • Hot reloading from a remote Git registry.
    • Running development and production environments.
  • Continuous Integration (CI) testing

    • Adding test coverage to a stitched schema.
    • Mocking subservices as local test fixtures.
  • Public and private APIs

    • Filtering unwanted fields from the final stitched schema.
    • Serving public (filtered) and private (unfiltered) API versions.

Other Integrations

  • Federation services

    • Integrating Apollo Federation services into a stitched schema.
    • Fetching and parsing Federation SDLs.
  • Subservice languages

    • JavaScript schemas created with:

      • graphql-js
      • nexus
      • type-graphql
    • Ruby schemas created with:

      • Class-based definitions
      • Parsed definitions string
  • GraphQL Upload

    • Adding GraphQL Upload to the gateway server

Appendices

More Repositories

1

backbone.epoxy

Declarative data binding and computed models for Backbone
JavaScript
614
star
2

sass-thematic

A parser for generating dynamic theme stylesheets from Sass.
JavaScript
118
star
3

technical-interview

Resources for Technical Interview prep session
HTML
91
star
4

gemoji-parser

The missing helper methods for GitHub's gemoji gem.
Ruby
72
star
5

graphql-stitching-ruby

GraphQL Schema Stitching for Ruby
Ruby
33
star
6

professional-javascript

Curriculum for Professional JavaScript classroom workshop.
HTML
31
star
7

sidekiq-heroku-autoscale

Dynamically start, stop, and scale Sidekiq dynos on Heroku based on queued jobs.
Ruby
24
star
8

backbone.containerview

A fast and efficient subview renderer and lifecycle manager.
JavaScript
22
star
9

constellation-js

A grid geometry toolkit for A* pathfinding and 2D sprite motion.
JavaScript
21
star
10

pods.js

Tiny managers for module definition and dependency management.
JavaScript
20
star
11

graphql-ruby-schema-directives

Generic implementation of schema directives for GraphQL Ruby
Ruby
6
star
12

federation-to-stitching-sdl

Format Federation SDL documents for use in a Schema Stitching gateway.
JavaScript
4
star
13

series-stats

Numeric series statistics algorithms and utility methods.
JavaScript
3
star
14

FishingGame

Canvas-based fishing game from "What Makes You Tick: A Stitch in Time"
JavaScript
2
star
15

graphql-asia-demo

Countries API + UNESCO World Heritage site data for GraphQL Asia demo
JavaScript
2
star
16

lassie-rails

Lassie game engine on Rails
JavaScript
1
star
17

lassie-js

JavaScript
1
star
18

muppets-api

Ruby
1
star
19

mtginfo

JavaScript
1
star
20

happenstance

JavaScript
1
star
21

bubblechart.js

An animated time-based bubble chart (scatter plot) with JavaScript and SVG/HTML graphics.
JavaScript
1
star