UNPKG

@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.3 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.processDirectives = void 0; exports.loadGraphQLSchemaFromRAML = loadGraphQLSchemaFromRAML; exports.loadNonExecutableGraphQLSchemaFromRAML = loadNonExecutableGraphQLSchemaFromRAML; 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, }); } async function loadNonExecutableGraphQLSchemaFromRAML(name, options) { const extraJSONSchemaOptions = await (0, getJSONSchemaOptionsFromRAMLOptions_js_1.getJSONSchemaOptionsFromRAMLOptions)(options); return (0, json_schema_1.loadNonExecutableGraphQLSchemaFromJSONSchemas)(name, { ...options, ...extraJSONSchemaOptions, }); } var json_schema_2 = require("@omnigraph/json-schema"); Object.defineProperty(exports, "processDirectives", { enumerable: true, get: function () { return json_schema_2.processDirectives; } });