@graphql-tools/utils 7.5.2 → 7.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.esm.js CHANGED
@@ -3352,6 +3352,10 @@ function pruneSchema(schema, options = {}) {
3352
3352
  visitTypes(pruningContext, schema);
3353
3353
  return mapSchema(schema, {
3354
3354
  [MapperKind.TYPE]: (type) => {
3355
+ // If we should NOT prune the type, return it immediately as unmodified
3356
+ if (options.skipPruning && options.skipPruning(type)) {
3357
+ return type;
3358
+ }
3355
3359
  if (isObjectType(type) || isInputObjectType(type)) {
3356
3360
  if ((!Object.keys(type.getFields()).length && !options.skipEmptyCompositeTypePruning) ||
3357
3361
  (pruningContext.unusedTypes[type.name] && !options.skipUnusedTypesPruning)) {