Packages

@graphql-tools/schema

11.0.9 · 10 Nov 2026MIT26.1M / weekRepositoryHomepagenpmAtom feed

Your version

9.0.0

major9 Aug 2022Where it was published

9.0.19 is the newest release of 9.x.

In short

1 fixed2 internal

Release note

The section about @graphql-tools/schema of a note shared by several packages.

Major Changes

Breaking changes

addResolversToSchema;

If you are using the legacy parameters like below, you should update them to the new usage. Other
than that, there is no functional change;

// From
addResolversToSchema(schema, resolvers, resolverValidationOptions)

// To
addResolversToSchema({
  schema,
  resolvers,
  resolverValidationOptions
})

mergeSchemas;

The provided resolver overrides the resolvers in the schema with the same name;

The hello resolver in the schema would be overridden by the hello resolver in the
resolvers. Before it was opposite which is not expected.

const schema = makeExecutableSchema({
  typeDefs: `
    type Query {
      hello: String
    }
  `,
  resolvers: {
    Query: {
      hello: () => 'Hello world!'
    }
  }
})

mergeSchemas({
  schemas: [schema],
  resolvers: {
    Query: {
      hello: () => 'New hello world'
    }
  }
})

makeExecutableSchema no longer takes parseOptions and you can pass those options directly;

makeExecutableSchema({
  typeDefs: ``,
  parseOptions: {
    assumeValid: true
  }
})

// After
makeExecutableSchema({
  typeDefs: ``,
  assumeValid: true
})

makeExecutableSchema no longer does pruning and it doesn't take pruningOptions anymore. You
can use pruneSchema from @graphql-tools/utils if you need.

extractExtensionsFromSchema moved from @graphql-tools/merge to @graphql-tools/schema. And
travelSchemaPossibleExtensions has been dropped in favor of mapSchema.

Patch Changes

  • #4624
    e3167edc
    Thanks @n1ru4l! - Fix CommonJS TypeScript resolution with
    moduleResolution node16 or nodenext

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.