github ardatan/graphql-tools release-1716805704148
May 27, 2024

latest releases: release-1732269407946, graphql-tools@9.0.4, @graphql-tools/utils@10.6.0...
6 months ago

@graphql-tools/batch-delegate@9.0.3

Patch Changes

@graphql-tools/delegate@10.0.11

Patch Changes

  • #6194
    7368829
    Thanks @ardatan! - Handle interface objects in a different way

  • #6188
    e10c13a
    Thanks @ardatan! - Add subtractSelectionSets to get the diff of
    two selection sets

  • #6187
    dfccfbf
    Thanks @ardatan! - Do not merge errors and regular resolved objects

    If a subschema returns an error for specific field that is already resolved by another subschema,
    the error should not be merged with the resolved object.

  • #6189
    0134f7f
    Thanks @ardatan! - Handle interface types with non-shared
    implementations;

    For example, you have the following services, where Node is implemented in both services, but
    Foo and Bar are only implemented in one service. And when the gateway receives the following
    query, it should be converted to this because Node is not implemented as Bar in Service 1
    while implemented in Service 2.

    Query conversion;

    # Gateway request
    query {
      fooBar(id: "1") {
        ... on Node {
          id
        }
      }
    }
    # Service 1 Request
    query {
      fooBar(id: "1") {
        ... on Foo {
          id
        }
        ... on Bar {
          id
        }
      }
    }

    Services;

    # Service 1
    
    union FooBar = Foo | Bar
    
    interface Node {
      id: ID!
    }
    
    type Foo implements Node {
      id: ID!
    }
    
    type Bar {
      id: ID!
    }
    
    type Query {
      fooBar(id: ID!): FooBar
    }
    # Service 2
    interface Node {
      id: ID!
    }
    
    type Foo implements Node {
      id: ID!
    }
    
    type Bar implements Node {
      id: ID!
    }
  • Updated dependencies
    [7368829,
    e10c13a]:

    • @graphql-tools/schema@10.0.4
    • @graphql-tools/utils@10.2.1

@graphql-tools/federation@1.1.36

Patch Changes

  • #6194
    7368829
    Thanks @ardatan! - Handle interface objects in a different way

  • #6189
    0134f7f
    Thanks @ardatan! - Handle interface types with non-shared
    implementations;

    For example, you have the following services, where Node is implemented in both services, but
    Foo and Bar are only implemented in one service. And when the gateway receives the following
    query, it should be converted to this because Node is not implemented as Bar in Service 1
    while implemented in Service 2.

    Query conversion;

    # Gateway request
    query {
      fooBar(id: "1") {
        ... on Node {
          id
        }
      }
    }
    # Service 1 Request
    query {
      fooBar(id: "1") {
        ... on Foo {
          id
        }
        ... on Bar {
          id
        }
      }
    }

    Services;

    # Service 1
    
    union FooBar = Foo | Bar
    
    interface Node {
      id: ID!
    }
    
    type Foo implements Node {
      id: ID!
    }
    
    type Bar {
      id: ID!
    }
    
    type Query {
      fooBar(id: ID!): FooBar
    }
    # Service 2
    interface Node {
      id: ID!
    }
    
    type Foo implements Node {
      id: ID!
    }
    
    type Bar implements Node {
      id: ID!
    }
  • #6187
    dfccfbf
    Thanks @ardatan! - Respect @provides to optimize the query plan

  • #6188
    e10c13a
    Thanks @ardatan! - If two different subschemas have the root field,
    use the same field to resolve missing fields instead of applying a type merging in advance

  • Updated dependencies
    [7368829,
    e10c13a,
    e10c13a,
    dfccfbf,
    0134f7f,
    eec9d3d,
    03a47b1,
    e10c13a,
    0827497]:

    • @graphql-tools/delegate@10.0.11
    • @graphql-tools/schema@10.0.4
    • @graphql-tools/stitch@9.2.9
    • @graphql-tools/utils@10.2.1

@graphql-tools/mock@9.0.3

Patch Changes

  • #6201
    9d79b3e
    Thanks @grxy! - perf: only clone schema once in addMocksToSchema

  • Updated dependencies
    [7368829,
    e10c13a]:

    • @graphql-tools/schema@10.0.4
    • @graphql-tools/utils@10.2.1

@graphql-tools/schema@10.0.4

Patch Changes

@graphql-tools/stitch@9.2.9

Patch Changes

  • #6194
    7368829
    Thanks @ardatan! - Handle interface objects in a different way

  • #6180
    eec9d3d
    Thanks @ardatan! - Handle nested dependencies in the computed fields

    {
      merge: {
        Product: {
          selectionSet: '{ id }',
          fields: {
            isExpensive: {
              selectionSet: '{ price }',
              computed: true,
            },
            canAfford: {
              selectionSet: '{ isExpensive }',
              computed: true,
            },
          }
        }
      }
    }
  • #6179
    03a47b1
    Thanks @ardatan! - Support computed fields resolved via a root field
    returning an interface When a computed field returning an object, and that field is resolved via
    an interface, the computed field will now be resolved correctly.

  • #6188
    e10c13a
    Thanks @ardatan! - Handle nested selections in
    calculateSelectionScore

  • #6175
    0827497
    Thanks @ardatan! - If there is a subschema with some selection set,
    and another with some other selection set. After the calculation of delegation stage, if one
    subschema can cover the other selection set as well, then we can merge the two selection sets into
    one, and remove the other subschema from the stage.

  • Updated dependencies
    [7368829,
    e10c13a,
    e10c13a,
    dfccfbf,
    0134f7f]:

    • @graphql-tools/batch-delegate@9.0.3
    • @graphql-tools/delegate@10.0.11
    • @graphql-tools/schema@10.0.4
    • @graphql-tools/utils@10.2.1

@graphql-tools/utils@10.2.1

Patch Changes

  • #6194
    7368829
    Thanks @ardatan! - Handle interface objects in a different way

  • #6188
    e10c13a
    Thanks @ardatan! - Add respectArrayLength flag to mergeDeep so
    instead of concatenating the arrays, elements of them will be merged if they have the same length

Don't miss a new graphql-tools release

NewReleases is sending notifications on new releases.