@omnigraph/raml
Version:
This package generates `GraphQLSchema` instance from **RAML API Document** (`.raml`) file located at a URL or FileSystem by resolving the JSON Schema dependencies. It uses `@omnigraph/json-schema` by generating the necessary configuration.
24 lines (23 loc) • 1.38 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.processDirectives = exports.loadNonExecutableGraphQLSchemaFromRAML = exports.loadGraphQLSchemaFromRAML = void 0;
const json_schema_1 = require("@omnigraph/json-schema");
const getJSONSchemaOptionsFromRAMLOptions_js_1 = require("./getJSONSchemaOptionsFromRAMLOptions.js");
async function loadGraphQLSchemaFromRAML(name, options) {
const extraJSONSchemaOptions = await (0, getJSONSchemaOptionsFromRAMLOptions_js_1.getJSONSchemaOptionsFromRAMLOptions)(options);
return (0, json_schema_1.loadGraphQLSchemaFromJSONSchemas)(name, {
...options,
...extraJSONSchemaOptions,
});
}
exports.loadGraphQLSchemaFromRAML = loadGraphQLSchemaFromRAML;
async function loadNonExecutableGraphQLSchemaFromRAML(name, options) {
const extraJSONSchemaOptions = await (0, getJSONSchemaOptionsFromRAMLOptions_js_1.getJSONSchemaOptionsFromRAMLOptions)(options);
return (0, json_schema_1.loadNonExecutableGraphQLSchemaFromJSONSchemas)(name, {
...options,
...extraJSONSchemaOptions,
});
}
exports.loadNonExecutableGraphQLSchemaFromRAML = loadNonExecutableGraphQLSchemaFromRAML;
var json_schema_2 = require("@omnigraph/json-schema");
Object.defineProperty(exports, "processDirectives", { enumerable: true, get: function () { return json_schema_2.processDirectives; } });