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.

18 lines (17 loc) 843 B
import { loadGraphQLSchemaFromJSONSchemas, loadNonExecutableGraphQLSchemaFromJSONSchemas, } from '@omnigraph/json-schema'; import { getJSONSchemaOptionsFromRAMLOptions } from './getJSONSchemaOptionsFromRAMLOptions.js'; export async function loadGraphQLSchemaFromRAML(name, options) { const extraJSONSchemaOptions = await getJSONSchemaOptionsFromRAMLOptions(options); return loadGraphQLSchemaFromJSONSchemas(name, { ...options, ...extraJSONSchemaOptions, }); } export async function loadNonExecutableGraphQLSchemaFromRAML(name, options) { const extraJSONSchemaOptions = await getJSONSchemaOptionsFromRAMLOptions(options); return loadNonExecutableGraphQLSchemaFromJSONSchemas(name, { ...options, ...extraJSONSchemaOptions, }); } export { processDirectives } from '@omnigraph/json-schema';