@omnigraph/json-schema
Version:
This package generates GraphQL Schema from JSON Schema and sample JSON request and responses. You can define your root field endpoints like below in your GraphQL Config for example;
17 lines (16 loc) • 714 B
TypeScript
import { Logger } from '@graphql-mesh/types';
import { JSONSchemaObject } from 'json-machete';
import { JSONSchemaOperationConfig } from './types';
export declare function getReferencedJSONSchemaFromOperations({ operations, cwd, schemaHeaders, ignoreErrorResponses, logger, fetchFn, baseUrl, operationHeaders, queryParams, }: {
operations: JSONSchemaOperationConfig[];
cwd: string;
schemaHeaders?: {
[key: string]: string;
};
ignoreErrorResponses?: boolean;
logger?: Logger;
fetchFn: WindowOrWorkerGlobalScope['fetch'];
baseUrl: string;
operationHeaders: Record<string, string>;
queryParams: Record<string, string | number | boolean>;
}): Promise<JSONSchemaObject>;