• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

gmac/schema-stitching-handbook: Guided examples exploring GraphQL Tools v6+ Sche ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

gmac/schema-stitching-handbook

开源软件地址(OpenSource Url):

https://github.com/gmac/schema-stitching-handbook

开源编程语言(OpenSource Language):

JavaScript 93.6%

开源软件介绍(OpenSource Introduction):

Schema Stitching Handbook

Guided examples of Schema Stitching doing awesome things. Focuses on the new (GraphQL Tools v6+) stitching using type merging, not legacy Apollo Stitching.

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




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap