diff --git a/src/schemaVisitor.ts b/src/schemaVisitor.ts index b94338d257e..9db069accc7 100644 --- a/src/schemaVisitor.ts +++ b/src/schemaVisitor.ts @@ -280,10 +280,6 @@ export function visitSchema( visit(schema); - // Automatically update any references to named schema types replaced during - // the traversal, so implementors don't have to worry about that. - healSchema(schema); - // Return the original schema for convenience, even though it cannot have // been replaced or removed by the code above. return schema; @@ -601,6 +597,10 @@ export class SchemaDirectiveVisitor extends SchemaVisitor { visitSchema(schema, visitorSelector); + // Automatically update any references to named schema types replaced + // during the traversal, so implementors don't have to worry about that. + healSchema(schema); + return createdVisitors; }