On this page

@graphql-inspector/patch

Changelog for @graphql-inspector/patch: every release with its changes and the pull requests behind them.

1.0.0

Major Changes

  • #2965 f640d71 Thanks @n1ru4l! - Add support for graphql-js@17.

    BREAKING Drop support for Node.js 20

    BREAKING Drop support for GraphQL 14 and 15

0.1.3

Patch Changes

0.1.2

Patch Changes

  • #2934 14b4410 Thanks @jdolle! - Add support for “extend schema” syntax to @graphql-inspector/core’s diff function and @graphql/inspector/patch. This allows directives to be defined on the schema such as extend schema @link(...) for federation

0.1.1

Patch Changes

  • #2930 4a37c05 Thanks @jdolle! - Add directive definition changes first; adjust adding repeat directive change

0.1.0

Minor Changes

  • #2923 9bfc094 Thanks @jdolle! - Adjust SCHEMA_*_TYPE_CHANGED changes to use null instead of ‘unknown’ when these types are not defined and improve the change messages.

0.0.1

Patch Changes

  • #2893 ef13125 Thanks @jdolle! - Initial release. Patch applies a list of changes (output from @graphql-inspector/core’s diff) to a GraphQL Schema.

    Example usage:

    import { buildSchema } from 'graphql'
    import { diff } from '@graphql-inspector/core'
    import { patchSchema } from '@graphql-inspector/patch'
    
    const schemaA = buildSchema(before, { assumeValid: true, assumeValidSDL: true })
    const schemaB = buildSchema(after, { assumeValid: true, assumeValidSDL: true })
    
    const changes = await diff(schemaA, schemaB)
    const patched = patchSchema(schemaA, changes)

    If working from an AST, you may alternatively use the exported patch function. But be careful to make sure directives are included in your AST or those changes will be missed.