github ardatan/graphql-tools @graphql-tools/stitch@7.4.0

latest releases: release-1727374913368, @graphql-tools/executor-graphql-ws@1.3.0, release-1727267678099...
3 years ago

Minor Changes

  • 0194118: Introduces a suite of stitched schema validations that enforce the integrity of merged schemas. This includes validations for:

    • Strict and safe null consistency (the later of which allows safe transitions in nullability).
    • Named type consistency with the option to whitelist proxiable scalar mappings.
    • Argument and input field name consistency.
    • Enum value consistency when used as an input value.

    Validations may be adjusted by setting validationLevel to off|warn|error globally or scoped for specific types and fields. In this initial v7 release, all validations are introduced at the warn threshold for backwards compatibility. Most of these validations will become automatic errors in v8. To enable validation errors now, set validationLevel: 'error'. Full configuration options look like this:

    const gatewaySchema = stitchSchemas({
      subschemas: [...],
      typeMergingOptions: {
        validationSettings: {
          validationLevel: 'error',
          strictNullComparison: false, // << gateway "String" may proxy subschema "String!"
          proxiableScalars: {
            ID: ['String'], // << gateway "ID" may proxy subschema "String"
          }
        },
        validationScopes: {
          // scope to specific element paths
          'User.id': {
            validationLevel: 'warn',
            strictNullComparison: true,
          },
        }
      },
    });

Patch Changes

  • Updated dependencies [0194118]
    • @graphql-tools/merge@6.2.10

Don't miss a new graphql-tools release

NewReleases is sending notifications on new releases.