function printFilteredSchema()

in src/printers.ts [64:85]


function printFilteredSchema(
    schema: GraphQLSchema,
    directiveFilter: (type: GraphQLDirective) => boolean,
    typeFilter: (type: GraphQLNamedType) => boolean,
): string {
    const directives = schema.getDirectives().filter(directiveFilter);
    const typeMap = schema.getTypeMap();
    const types = objectValues(typeMap)
        .sort((type1, type2) => type1.name.localeCompare(type2.name))
        .filter(typeFilter);

    return (
        [printSchemaDefinition(schema)]
            .concat(
                directives.map((directive) => printDirective(directive)),
                types.map((type) => printType(type)),
            )
            .filter(Boolean)
            .join('\n\n') + '\n'
    );

}