UNPKG

@graphql-tools/graphql

Version:
13 lines (12 loc) 741 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.printSchemaWithDirectives = void 0; const index_js_1 = require("../language/index.js"); const getDocumentNodeFromSchema_js_1 = require("./getDocumentNodeFromSchema.js"); // this approach uses the default schema printer rather than a custom solution, so may be more backwards compatible // currently does not allow customization of printSchema options having to do with comments. function printSchemaWithDirectives(schema, options = {}) { const documentNode = (0, getDocumentNodeFromSchema_js_1.getDocumentNodeFromSchema)(schema, options); return (0, index_js_1.print)(documentNode); } exports.printSchemaWithDirectives = printSchemaWithDirectives;