Skip to content

Commit

Permalink
Call healSchema in visitSchemaDirectives rather than in visitSchema.
Browse files Browse the repository at this point in the history
It should be possible to visit a schema without going to the trouble of
healing it as well.
  • Loading branch information
benjamn committed Mar 14, 2018
1 parent 31b8fb2 commit 63cec8e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/schemaVisitor.ts
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 63cec8e

Please sign in to comment.