use of graphql.schema.GraphQLTypeResolvingVisitor in project graphql-java by graphql-java.
the class SchemaUtil method replaceTypeReferences.
public static void replaceTypeReferences(GraphQLSchema schema) {
final Map<String, GraphQLNamedType> typeMap = schema.getTypeMap();
List<GraphQLSchemaElement> roots = new ArrayList<>(typeMap.values());
roots.addAll(schema.getDirectives());
SchemaTraverser schemaTraverser = new SchemaTraverser(schemaElement -> schemaElement.getChildrenWithTypeReferences().getChildrenAsList());
schemaTraverser.depthFirst(new GraphQLTypeResolvingVisitor(typeMap), roots);
}
Aggregations