From 63cec8ea09d7e52b158ae2ea6ade63fc60fc3759 Mon Sep 17 00:00:00 2001 From: Ben Newman Date: Sat, 10 Mar 2018 10:31:05 -0500 Subject: [PATCH] Call healSchema in visitSchemaDirectives rather than in visitSchema. It should be possible to visit a schema without going to the trouble of healing it as well. --- src/schemaVisitor.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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; }