Skip to content

Releases: ardatan/graphql-tools

April 29, 2024

29 Apr 15:33
9d79ba2
Compare
Choose a tag to compare

@graphql-tools/delegate@10.0.7

Patch Changes

@graphql-tools/federation@1.1.29

Patch Changes

  • #6109 074fad4 Thanks @ardatan! - Show responses in debug logging with DEBUG env var

  • Updated dependencies [074fad4, 074fad4]:

    • @graphql-tools/delegate@10.0.7
    • @graphql-tools/stitch@9.2.3

@graphql-tools/stitch@9.2.3

Patch Changes

  • #6109 074fad4 Thanks @ardatan! - Exclude fields with __typename while extracting missing fields for the type merging

  • Updated dependencies [074fad4]:

    • @graphql-tools/delegate@10.0.7

April 29, 2024

29 Apr 14:09
663130d
Compare
Choose a tag to compare

@graphql-tools/stitch@9.2.2

Patch Changes

April 29, 2024

29 Apr 12:19
7ef2ad7
Compare
Choose a tag to compare

@graphql-tools/stitch@9.2.1

Patch Changes

@graphql-tools/utils@10.2.0

Minor Changes

Patch Changes

  • #6105 5567347 Thanks @ardatan! - Handle fields in unmerged types as both isolated and non-isolated fields

April 26, 2024

26 Apr 23:42
7014a4a
Compare
Choose a tag to compare

@graphql-tools/prisma-loader@8.0.4

Patch Changes

April 26, 2024

26 Apr 13:37
35a3c31
Compare
Choose a tag to compare

@graphql-tools/delegate@10.0.6

Patch Changes

  • af7be09 Thanks @ardatan! - Hotfix: do not use nullable and nonNullable prefixes if field names don't match

April 26, 2024

26 Apr 12:42
3d5323d
Compare
Choose a tag to compare

@graphql-tools/delegate@10.0.5

Patch Changes

  • #6091 9bca9e0 Thanks @User, @User! - If the gateway receives a query with an overlapping fields for the subschema, it uses aliases to resolve it correctly.

    Let's say subschema A has the following schema;

      type Query {
    
      }
    
      interface User {
        id: ID!
        name: String!
      }
    
      type Admin implements User {
        id: ID!
        name: String!
        role: String!
      }
    
      type Customer implements User {
        id: ID!
        name: String
        email: String
      }

    And let's say the gateway has the following schema instead;

      type Query {
    
      }
    
      interface User {
        id: ID!
        name: String!
      }
    
      type Admin implements User {
        id: ID!
        name: String!
        role: String!
      }
    
      type Customer implements User {
        id: ID!
        name: String!
        email: String!
      }

    In this case, the following query is fine for the gateway but for the subschema, it's not;

    query {
      user {
        ... on Admin {
          id
          name # This is nullable in the subschema
          role
        }
        ... on Customer {
          id
          name # This is non-nullable in the subschema
          email
        }
      }
    }

    So the subgraph will throw based on this rule OverlappingFieldsCanBeMerged

    To avoid this, the gateway will use aliases to resolve the query correctly. The query will be transformed to the following;

    query {
      user {
        ... on Admin {
          id
          name # This is nullable in the subschema
          role
        }
        ... on Customer {
          id
          name: _nullable_name # This is non-nullable in the subschema
          email
        }
      }
    }
  • #6092 243c353 Thanks @ardatan! - If one of the subgraphs are already able to resolve a nested field as in parent-entity-call example's Category.details from C's Product, resolve it from there instead of using type merging.

    query {
      product {
        category {
          details {
            # This is coming from C's Product, so resolve it from there instead of Type Merging
            id
            name
          }
        }
      }
    }

@graphql-tools/federation@1.1.28

Patch Changes

  • #6091 9bca9e0 Thanks @User, @User! - If the gateway receives a query with an overlapping fields for the subschema, it uses aliases to resolve it correctly.

    Let's say subschema A has the following schema;

      type Query {
    
      }
    
      interface User {
        id: ID!
        name: String!
      }
    
      type Admin implements User {
        id: ID!
        name: String!
        role: String!
      }
    
      type Customer implements User {
        id: ID!
        name: String
        email: String
      }

    And let's say the gateway has the following schema instead;

      type Query {
    
      }
    
      interface User {
        id: ID!
        name: String!
      }
    
      type Admin implements User {
        id: ID!
        name: String!
        role: String!
      }
    
      type Customer implements User {
        id: ID!
        name: String!
        email: String!
      }

    In this case, the following query is fine for the gateway but for the subschema, it's not;

    query {
      user {
        ... on Admin {
          id
          name # This is nullable in the subschema
          role
        }
        ... on Customer {
          id
          name # This is non-nullable in the subschema
          email
        }
      }
    }

    So the subgraph will throw based on this rule OverlappingFieldsCanBeMerged

    To avoid this, the gateway will use aliases to resolve the query correctly. The query will be transformed to the following;

    query {
      user {
        ... on Admin {
          id
          name # This is nullable in the subschema
          role
        }
        ... on Customer {
          id
          name: _nullable_name # This is non-nullable in the subschema
          email
        }
      }
    }
  • Updated dependencies [9bca9e0, 9bca9e0, 243c353]:

    • @graphql-tools/stitch@9.2.0
    • @graphql-tools/delegate@10.0.5

@graphql-tools/stitch@9.2.0

Minor Changes

  • #6091 9bca9e0 Thanks @User, @User! - New option useNonNullableFieldOnConflict in typeMergingOptions of stitchSchemas

    When you have two schemas like below, you will get a warning about the conflicting fields because name field is defined as non-null in one schema and nullable in the other schema, and non-nullable field can exist in the stitched schema because of the order or any other reasons, and this might actually cause an unexpected behavior when you fetch User.name from the one who has it as non-nullable.
    This option supresses the warning, and takes the field from the schema that has it as non-nullable.

      type Query {
    
      }
    
      type User {
        id: ID!
        name: String
        email: String
      }

    And;

      type Query {
    
      }
    
      type User {
        id: ID!
        name: String!
      }

Patch Changes

  • #6091 9bca9e0 Thanks @User, @User! - If the gateway receives a query with an overlapping fields for the subschema, it uses aliases to resolve it correctly.

    Let's say subschema A has the following schema;

      type Query {
    
      }
    
      interface User {
        id: ID!
        name: String!
      }
    
      type Admin implements User {
        id: ID!
        name: String!
        role: String!
      }
    
      type Customer implements User {
        id: ID!
        name: String
        email: String
      }

    And let's say the gateway has the following schema instead;

      type Query {
    
      }
    
      interface User {
        id: ID!
        name: String!
      }
    
      type Admin implements User {
        id: ID!
        name: String!
        role: String!
      }
    
      type Customer implements User {
        id: ID!
        name: String!
        email: String!
      }

    In this case, the following query is fine for the gateway but for the subschema, it's not;

    query {
      user {
        ... on Admin {
          id
          name # This is nullable in the subschema
          role
        }
        ... on Customer {
          id
          name # This is non-nullable in the subschema
          email
        }
      }
    }

    So the subgraph will throw based on this rule OverlappingFieldsCanBeMerged

    To avoid this, the gateway will use aliases to resolve the query correctly. The query will be transformed to the following;

    query {
      user {
        ... on Admin {
          id
          name # This is nullable in the subschema
          role
        }
        ... on Customer {
          id
          name: _nullable_name # This is non-nullable in the subschema
          email
        }
      }
    }
  • #6092 243c353 Thanks @ardatan! - If one of the subgraphs are already able to resolve a nested field as in parent-entity-call example's Category.details from C's Product, resolve it from there instead of using type merging.

    query {
      product {
        category {
          details {
            # This is coming from C's Product, so resolve it from there instead of Type Merging
            id
            name
          }
        }
      }
    }
  • Updated dependencies [9bca9e0, 243c353]:

    • @graphql-tools/delegate@10.0.5

April 24, 2024

24 Apr 18:43
58b9b8b
Compare
Choose a tag to compare

@graphql-tools/federation@1.1.27

Patch Changes

April 24, 2024

24 Apr 12:24
3e0d8f2
Compare
Choose a tag to compare

@graphql-tools/stitch@9.1.2

Patch Changes

  • 6d26702 Thanks @ardatan! - Respect interface types as computed field types

April 24, 2024

24 Apr 07:04
ee853ed
Compare
Choose a tag to compare

@graphql-tools/stitch@9.1.1

Patch Changes

  • c5df958 Thanks @ardatan! - Prevent infinite loop while visiting over the computed field types

April 19, 2024

19 Apr 16:11
ce12c85
Compare
Choose a tag to compare

@graphql-tools/batch-delegate@9.0.2

Patch Changes

@graphql-tools/federation@1.1.26

Patch Changes