github ardatan/graphql-tools @graphql-tools/delegate@7.1.2

latest releases: release-1731509960802, graphql-tools@9.0.3, @graphql-tools/wrap@10.0.16...
3 years ago

Patch Changes

  • 6aed171: Allows MergedTypeConfig to be written with an entryPoints array for multiple merged type entry points, each with their own fieldName and selectionSet:

    {
      schema: testSchema,
      merge: {
        Product: {
          entryPoints: [{
            selectionSet: '{ id }',
            fieldName: 'productById',
            key: ({ id, price, weight }) => ({ id, price, weight }),
            argsFromKeys: (key) => ({ key }),
          }, {
            selectionSet: '{ upc }',
            fieldName: 'productByUpc',
            key: ({ upc, price, weight }) => ({ upc, price, weight }),
            argsFromKeys: (key) => ({ key }),
          }],
        }
      }
    }

    These multiple entry points accommodate types with multiple keys across services that rely on a central service to join them, for example:

    • Catalog service: type Product { upc }
    • Vendors service: type Product { upc id }
    • Reviews service: type Product { id }

    Given this graph, the possible traversals require the Vendors service to provide entry points for each unique key format:

    • Catalog > Vendors > Reviews
    • Catalog < Vendors > Reviews
    • Catalog < Vendors < Reviews

    Is it highly recommended that you enable query batching for subschemas with multiple entry points.

Don't miss a new graphql-tools release

NewReleases is sending notifications on new releases.