@graphql-mesh/types
Version:
1,304 lines (1,303 loc) • 160 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.jsonSchema = void 0;
exports.jsonSchema = {
definitions: {
Cache: {
additionalProperties: true,
type: 'object',
title: 'Cache',
properties: {
cfwKv: {
$ref: '#/definitions/CFWorkersKVCacheConfig',
},
file: {
$ref: '#/definitions/FileCacheConfig',
},
localforage: {
$ref: '#/definitions/LocalforageConfig',
},
redis: {
$ref: '#/definitions/RedisConfig',
},
},
},
CFWorkersKVCacheConfig: {
additionalProperties: false,
type: 'object',
title: 'CFWorkersKVCacheConfig',
properties: {
namespace: {
type: 'string',
description: 'The name of the Workers KV namespace to use for caching.\n\nMake sure you have configured the following namespace described in [here](https://developers.cloudflare.com/workers/wrangler/cli-wrangler/commands/#kv).',
},
},
required: ['namespace'],
},
FileCacheConfig: {
additionalProperties: false,
type: 'object',
title: 'FileCacheConfig',
properties: {
path: {
type: 'string',
},
},
},
LocalforageConfig: {
additionalProperties: false,
type: 'object',
title: 'LocalforageConfig',
properties: {
driver: {
type: 'array',
items: {
type: 'string',
enum: ['WEBSQL', 'INDEXEDDB', 'LOCALSTORAGE'],
description: 'Allowed values: WEBSQL, INDEXEDDB, LOCALSTORAGE',
},
additionalItems: false,
description: 'Allowed values: WEBSQL, INDEXEDDB, LOCALSTORAGE',
},
name: {
type: 'string',
},
version: {
type: 'number',
},
size: {
type: 'integer',
},
storeName: {
type: 'string',
},
description: {
type: 'string',
},
},
},
RedisConfig: {
additionalProperties: false,
type: 'object',
title: 'RedisConfig',
properties: {
host: {
type: 'string',
},
port: {
type: 'string',
},
password: {
type: 'string',
},
url: {
type: 'string',
},
},
},
ServeConfig: {
additionalProperties: false,
type: 'object',
title: 'ServeConfig',
properties: {
fork: {
description: 'Spawn multiple server instances as node clusters (default: `1`) (Any of: Int, Boolean)',
anyOf: [
{
type: 'integer',
},
{
type: 'boolean',
},
],
},
port: {
description: 'TCP Port to listen (default: `4000`) (Any of: Int, String)',
anyOf: [
{
type: 'integer',
},
{
type: 'string',
},
],
},
hostname: {
type: 'string',
description: 'The binding hostname (default: `localhost`)',
},
cors: {
$ref: '#/definitions/CorsConfig',
description: 'Configuration for CORS',
},
staticFiles: {
type: 'string',
description: 'Path to your static files you want to be served with GraphQL Mesh HTTP Server',
},
playground: {
type: 'boolean',
description: 'Show GraphiQL Playground',
},
sslCredentials: {
$ref: '#/definitions/HTTPSConfig',
description: 'SSL Credentials for HTTPS Server\nIf this is provided, Mesh will be served via HTTPS',
},
endpoint: {
type: 'string',
description: 'Path to GraphQL Endpoint (default: /graphql)',
},
browser: {
description: 'Path to the browser that will be used by `mesh serve` to open a playground window in development mode\nThis feature can be disabled by passing `false` (Any of: String, Boolean)',
anyOf: [
{
type: 'string',
},
{
type: 'boolean',
},
],
},
playgroundTitle: {
type: 'string',
description: 'Title of GraphiQL Playground',
},
trustProxy: {
type: 'string',
description: 'Configure Express Proxy Handling\n[Learn more](https://expressjs.com/en/guide/behind-proxies.html)',
},
},
},
CorsConfig: {
additionalProperties: false,
type: 'object',
title: 'CorsConfig',
properties: {
origin: {
anyOf: [
{
type: 'object',
additionalProperties: true,
},
{
type: 'string',
},
{
type: 'array',
additionalItems: true,
},
],
},
allowedHeaders: {
type: 'array',
items: {
type: 'string',
},
additionalItems: false,
},
exposedHeaders: {
type: 'array',
items: {
type: 'string',
},
additionalItems: false,
},
credentials: {
type: 'boolean',
},
maxAge: {
type: 'integer',
},
preflightContinue: {
type: 'boolean',
},
optionsSuccessStatus: {
type: 'integer',
},
},
},
HTTPSConfig: {
additionalProperties: false,
type: 'object',
title: 'HTTPSConfig',
properties: {
key: {
type: 'string',
},
cert: {
type: 'string',
},
},
required: ['key', 'cert'],
},
SDKConfig: {
additionalProperties: false,
type: 'object',
title: 'SDKConfig',
properties: {
generateOperations: {
$ref: '#/definitions/GenerateOperationsConfig',
description: "Use this only if you don't want to use `documents` for SDK,\nand let Mesh generate them for you",
},
},
},
GenerateOperationsConfig: {
additionalProperties: false,
type: 'object',
title: 'GenerateOperationsConfig',
properties: {
selectionSetDepth: {
type: 'integer',
},
},
},
Source: {
additionalProperties: false,
type: 'object',
title: 'Source',
properties: {
name: {
type: 'string',
description: 'The name you wish to set to your remote API, this will be used for building the GraphQL context',
},
handler: {
$ref: '#/definitions/Handler',
description: 'Point to the handler you wish to use, it can either be a predefined handler, or a custom',
},
transforms: {
type: 'array',
items: {
$ref: '#/definitions/Transform',
},
additionalItems: false,
description: 'List of transforms to apply to the current API source, before unifying it with the rest of the sources',
},
},
required: ['name', 'handler'],
},
Transform: {
additionalProperties: true,
type: 'object',
title: 'Transform',
properties: {
cache: {
type: 'array',
items: {
$ref: '#/definitions/CacheTransformConfig',
},
additionalItems: false,
description: 'Transformer to apply caching for your data sources',
},
encapsulate: {
$ref: '#/definitions/EncapsulateTransformObject',
description: 'Transformer to apply encapsulation to the API source, by creating a field for it under the root query',
},
extend: {
$ref: '#/definitions/ExtendTransform',
},
federation: {
$ref: '#/definitions/FederationTransform',
},
filterSchema: {
description: 'Transformer to filter (white/black list) GraphQL types, fields and arguments (Any of: FilterSchemaTransform, Any)',
anyOf: [
{
$ref: '#/definitions/FilterSchemaTransform',
},
{
anyOf: [
{
type: 'object',
additionalProperties: true,
},
{
type: 'string',
},
{
type: 'array',
additionalItems: true,
},
],
},
],
},
hoistField: {
type: 'array',
items: {
$ref: '#/definitions/HoistFieldTransformConfig',
},
additionalItems: false,
description: 'Transformer to hoist GraphQL fields',
},
namingConvention: {
$ref: '#/definitions/NamingConventionTransformConfig',
description: 'Transformer to apply naming convention to GraphQL Types',
},
prefix: {
$ref: '#/definitions/PrefixTransformConfig',
description: 'Prefix transform',
},
prune: {
$ref: '#/definitions/PruneTransformConfig',
description: 'Prune transform',
},
rateLimit: {
type: 'array',
items: {
$ref: '#/definitions/RateLimitTransformConfig',
},
additionalItems: false,
description: 'RateLimit transform',
},
rename: {
description: 'Transformer to rename GraphQL types and fields (Any of: RenameTransform, Any)',
anyOf: [
{
$ref: '#/definitions/RenameTransform',
},
{
anyOf: [
{
type: 'object',
additionalProperties: true,
},
{
type: 'string',
},
{
type: 'array',
additionalItems: true,
},
],
},
],
},
replaceField: {
$ref: '#/definitions/ReplaceFieldTransformConfig',
description: 'Transformer to replace GraphQL field with partial of full config from a different field',
},
resolversComposition: {
description: 'Transformer to apply composition to resolvers (Any of: ResolversCompositionTransform, Any)',
anyOf: [
{
$ref: '#/definitions/ResolversCompositionTransform',
},
{
anyOf: [
{
type: 'object',
additionalProperties: true,
},
{
type: 'string',
},
{
type: 'array',
additionalItems: true,
},
],
},
],
},
transferSchema: {
$ref: '#/definitions/TransferSchemaTransformConfig',
description: 'Transformer to transfer (move or copy) GraphQL parts of GraphQL schema across Types and Fields',
},
typeMerging: {
$ref: '#/definitions/TypeMergingConfig',
description: '[Type Merging](https://www.graphql-tools.com/docs/stitch-type-merging) Configuration',
},
},
},
Handler: {
additionalProperties: true,
type: 'object',
title: 'Handler',
properties: {
graphql: {
description: 'Handler for remote/local/third-party GraphQL schema (Any of: GraphQLHandlerHTTPConfiguration, GraphQLHandlerCodeFirstConfiguration, GraphQLHandlerMultipleHTTPConfiguration)',
anyOf: [
{
$ref: '#/definitions/GraphQLHandlerHTTPConfiguration',
},
{
$ref: '#/definitions/GraphQLHandlerCodeFirstConfiguration',
},
{
$ref: '#/definitions/GraphQLHandlerMultipleHTTPConfiguration',
},
],
},
grpc: {
$ref: '#/definitions/GrpcHandler',
description: 'Handler for gRPC and Protobuf schemas',
},
jsonSchema: {
$ref: '#/definitions/JsonSchemaHandler',
description: 'Handler for JSON Schema specification.\nSource could be a local json file, or a url to it.',
},
mongoose: {
$ref: '#/definitions/MongooseHandler',
},
mysql: {
$ref: '#/definitions/MySQLHandler',
},
neo4j: {
$ref: '#/definitions/Neo4jHandler',
description: 'Handler for Neo4j',
},
odata: {
$ref: '#/definitions/ODataHandler',
description: 'Handler for OData',
},
openapi: {
$ref: '#/definitions/OpenapiHandler',
description: 'Handler for Swagger / OpenAPI 2/3 specification. Source could be a local json/swagger file, or a url to it.',
},
postgraphile: {
$ref: '#/definitions/PostGraphileHandler',
description: 'Handler for Postgres database, based on `postgraphile`',
},
raml: {
$ref: '#/definitions/RAMLHandler',
},
soap: {
$ref: '#/definitions/SoapHandler',
description: 'Handler for SOAP',
},
thrift: {
$ref: '#/definitions/ThriftHandler',
description: 'Handler for OData',
},
tuql: {
$ref: '#/definitions/TuqlHandler',
description: 'Handler for SQLite database, based on `tuql`',
},
},
},
Plugin: {
additionalProperties: true,
type: 'object',
title: 'Plugin',
properties: {
maskedErrors: {
$ref: '#/definitions/MaskedErrorsPluginConfig',
},
immediateIntrospection: {
anyOf: [
{
type: 'object',
additionalProperties: true,
},
{
type: 'string',
},
{
type: 'array',
additionalItems: true,
},
],
},
deduplicateRequest: {
anyOf: [
{
type: 'object',
additionalProperties: true,
},
{
type: 'string',
},
{
type: 'array',
additionalItems: true,
},
],
},
hive: {
$ref: '#/definitions/HivePlugin',
},
httpCache: {
$ref: '#/definitions/HTTPCachePlugin',
},
httpDetailsExtensions: {
$ref: '#/definitions/HTTPDetailsExtensionsConfig',
},
http2: {
$ref: '#/definitions/Http2Plugin',
},
liveQuery: {
$ref: '#/definitions/LiveQueryConfig',
},
mock: {
$ref: '#/definitions/MockingConfig',
description: 'Mock configuration for your source',
},
newrelic: {
$ref: '#/definitions/NewrelicConfig',
},
operationFieldPermissions: {
$ref: '#/definitions/OperationFieldPermissionsConfig',
},
prometheus: {
$ref: '#/definitions/PrometheusConfig',
},
rateLimit: {
$ref: '#/definitions/RateLimitPluginConfig',
description: 'RateLimit plugin',
},
responseCache: {
$ref: '#/definitions/ResponseCacheConfig',
},
serializeHeaders: {
$ref: '#/definitions/SerializeHeadersConfig',
},
snapshot: {
$ref: '#/definitions/SnapshotPluginConfig',
description: 'Configuration for Snapshot extension',
},
statsd: {
$ref: '#/definitions/StatsdPlugin',
},
},
},
MaskedErrorsPluginConfig: {
additionalProperties: false,
type: 'object',
title: 'MaskedErrorsPluginConfig',
properties: {
errorMessage: {
type: 'string',
},
},
},
AdditionalStitchingResolverObject: {
additionalProperties: false,
type: 'object',
title: 'AdditionalStitchingResolverObject',
properties: {
sourceName: {
type: 'string',
},
sourceTypeName: {
type: 'string',
},
sourceFieldName: {
type: 'string',
},
sourceSelectionSet: {
type: 'string',
},
requiredSelectionSet: {
type: 'string',
},
sourceArgs: {
type: 'object',
properties: {},
},
targetTypeName: {
type: 'string',
},
targetFieldName: {
type: 'string',
},
result: {
type: 'string',
description: 'Extract specific property from the result',
},
resultType: {
type: 'string',
description: "If return types don't match,\nyou can specify a result type to apply inline fragment",
},
},
required: [
'sourceName',
'sourceTypeName',
'sourceFieldName',
'targetTypeName',
'targetFieldName',
],
},
AdditionalStitchingBatchResolverObject: {
additionalProperties: false,
type: 'object',
title: 'AdditionalStitchingBatchResolverObject',
properties: {
sourceName: {
type: 'string',
},
sourceTypeName: {
type: 'string',
},
sourceFieldName: {
type: 'string',
},
sourceSelectionSet: {
type: 'string',
},
requiredSelectionSet: {
type: 'string',
},
keyField: {
type: 'string',
},
keysArg: {
type: 'string',
},
additionalArgs: {
type: 'object',
properties: {},
},
targetTypeName: {
type: 'string',
},
targetFieldName: {
type: 'string',
},
result: {
type: 'string',
description: 'Extract specific property from the result',
},
resultType: {
type: 'string',
description: "If return types don't match,\nyou can specify a result type to apply inline fragment",
},
},
required: [
'sourceName',
'sourceTypeName',
'sourceFieldName',
'keyField',
'keysArg',
'targetTypeName',
'targetFieldName',
],
},
AdditionalSubscriptionObject: {
additionalProperties: false,
type: 'object',
title: 'AdditionalSubscriptionObject',
properties: {
targetTypeName: {
type: 'string',
},
targetFieldName: {
type: 'string',
},
pubsubTopic: {
type: 'string',
},
result: {
type: 'string',
},
filterBy: {
type: 'string',
},
},
required: ['targetTypeName', 'targetFieldName', 'pubsubTopic'],
},
PubSubConfig: {
additionalProperties: false,
type: 'object',
title: 'PubSubConfig',
properties: {
name: {
type: 'string',
},
config: {
anyOf: [
{
type: 'object',
additionalProperties: true,
},
{
type: 'string',
},
{
type: 'array',
additionalItems: true,
},
],
},
},
required: ['name'],
},
GraphQLHandlerMultipleHTTPConfiguration: {
additionalProperties: false,
type: 'object',
title: 'GraphQLHandlerMultipleHTTPConfiguration',
properties: {
sources: {
type: 'array',
items: {
$ref: '#/definitions/GraphQLHandlerHTTPConfiguration',
},
additionalItems: false,
description: 'HTTP Source Configurations',
},
strategy: {
type: 'string',
enum: ['fallback', 'race', 'highestValue'],
description: 'Handling strategy (default: fallback) (Allowed values: fallback, race, highestValue)',
},
strategyConfig: {
$ref: '#/definitions/GraphQLHandlerhighestValueStrategyConfig',
description: 'Handling strategy configuration',
},
},
required: ['sources'],
},
GraphQLHandlerhighestValueStrategyConfig: {
additionalProperties: false,
type: 'object',
title: 'GraphQLHandlerhighestValueStrategyConfig',
properties: {
selectionSet: {
type: 'string',
},
value: {
type: 'string',
},
},
required: ['selectionSet', 'value'],
},
GraphQLHandlerCodeFirstConfiguration: {
additionalProperties: false,
type: 'object',
title: 'GraphQLHandlerCodeFirstConfiguration',
properties: {
source: {
anyOf: [
{
type: 'object',
additionalProperties: true,
},
{
type: 'string',
},
{
type: 'array',
additionalItems: true,
},
],
description: 'A file path to your GraphQL Schema\nIf you provide a path to a code file(js or ts),\nother options will be ignored and the schema exported from the file will be used directly.',
},
},
required: ['source'],
},
GraphQLHandlerHTTPConfiguration: {
additionalProperties: false,
type: 'object',
title: 'GraphQLHandlerHTTPConfiguration',
properties: {
endpoint: {
type: 'string',
description: 'A url or file path to your remote GraphQL endpoint.\nIf you provide a path to a code file(js or ts),\nother options will be ignored and the schema exported from the file will be used directly.',
},
schemaHeaders: {
anyOf: [
{
type: 'object',
additionalProperties: true,
},
{
type: 'string',
},
{
type: 'array',
additionalItems: true,
},
],
description: 'JSON object representing the Headers to add to the runtime of the API calls only for schema introspection',
},
operationHeaders: {
type: 'object',
properties: {},
description: 'JSON object representing the Headers to add to the runtime of the API calls only for operation during runtime',
},
useGETForQueries: {
type: 'boolean',
description: 'Use HTTP GET for Query operations',
},
method: {
type: 'string',
enum: ['GET', 'POST'],
description: 'HTTP method used for GraphQL operations (Allowed values: GET, POST)',
},
credentials: {
type: 'string',
enum: ['omit', 'include'],
description: 'Request Credentials if your environment supports it.\n[See more](https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials)\n\n@default "same-origin" (Allowed values: omit, include)',
},
webSocketImpl: {
type: 'string',
description: 'Path to a custom W3 Compatible WebSocket Implementation',
},
source: {
type: 'string',
description: 'Path to the introspection\nYou can separately give schema introspection or SDL',
},
subscriptionsProtocol: {
type: 'string',
enum: ['SSE', 'WS', 'LEGACY_WS'],
description: 'SSE - Server Sent Events\nWS - New graphql-ws\nLEGACY_WS - Legacy subscriptions-transport-ws (Allowed values: SSE, WS, LEGACY_WS)',
},
subscriptionsEndpoint: {
type: 'string',
description: 'URL to your endpoint serving all subscription queries for this source',
},
retry: {
type: 'integer',
description: 'Retry attempts if fails',
},
timeout: {
type: 'integer',
description: 'Timeout in milliseconds',
},
batch: {
type: 'boolean',
description: 'Enable/Disable automatic query batching',
},
},
required: ['endpoint'],
},
GrpcHandler: {
additionalProperties: false,
type: 'object',
title: 'GrpcHandler',
properties: {
endpoint: {
type: 'string',
description: 'gRPC Endpoint',
},
source: {
description: 'gRPC Proto file that contains your protobuf schema\nOR\nUse a binary-encoded or JSON file descriptor set file (Any of: ProtoFilePath, String)',
anyOf: [
{
$ref: '#/definitions/ProtoFilePath',
},
{
type: 'string',
},
],
},
requestTimeout: {
type: 'integer',
description: 'Request timeout in milliseconds\nDefault: 200000',
},
credentialsSsl: {
$ref: '#/definitions/GrpcCredentialsSsl',
description: 'SSL Credentials',
},
useHTTPS: {
type: 'boolean',
description: 'Use https instead of http for gRPC connection',
},
metaData: {
type: 'object',
properties: {},
description: 'MetaData',
},
prefixQueryMethod: {
type: 'array',
items: {
type: 'string',
},
additionalItems: false,
description: 'prefix to collect Query method default: list, get',
},
},
required: ['endpoint'],
},
LoadOptions: {
additionalProperties: false,
type: 'object',
title: 'LoadOptions',
properties: {
defaults: {
type: 'boolean',
},
includeDirs: {
type: 'array',
items: {
type: 'string',
},
additionalItems: false,
},
},
},
ProtoFilePath: {
additionalProperties: false,
type: 'object',
title: 'ProtoFilePath',
properties: {
file: {
type: 'string',
},
load: {
$ref: '#/definitions/LoadOptions',
},
},
required: ['file'],
},
GrpcCredentialsSsl: {
additionalProperties: false,
type: 'object',
title: 'GrpcCredentialsSsl',
properties: {
rootCA: {
type: 'string',
},
certChain: {
type: 'string',
},
privateKey: {
type: 'string',
},
},
},
QueryStringOptions: {
additionalProperties: false,
type: 'object',
title: 'QueryStringOptions',
properties: {
indices: {
type: 'boolean',
description: 'When arrays are stringified, by default they are not given explicit indices:\n`a=b&a=c&a=d`\nYou may override this by setting the indices option to true:\n`a[0]=b&a[1]=c&a[2]=d`',
},
arrayFormat: {
type: 'string',
enum: ['indices', 'brackets', 'repeat', 'comma'],
description: "You can configure how to format arrays in the query strings.\n\nNote: when using arrayFormat set to 'comma', you can also pass the commaRoundTrip option set to true or false, to append [] on single-item arrays, so that they can round trip through a parse. (Allowed values: indices, brackets, repeat, comma)",
},
commaRoundTrip: {
type: 'boolean',
description: 'Even if there is a single item in an array, this option treats them as arrays\n(default: false)',
},
},
},
JsonSchemaHandler: {
additionalProperties: false,
type: 'object',
title: 'JsonSchemaHandler',
properties: {
source: {
type: 'string',
description: 'Path to the bundle file',
},
endpoint: {
type: 'string',
},
operationHeaders: {
type: 'object',
properties: {},
},
schemaHeaders: {
type: 'object',
properties: {},
},
operations: {
type: 'array',
items: {
description: 'Any of: JsonSchemaHTTPOperation, JsonSchemaPubSubOperation',
anyOf: [
{
$ref: '#/definitions/JsonSchemaHTTPOperation',
},
{
$ref: '#/definitions/JsonSchemaPubSubOperation',
},
],
},
additionalItems: false,
description: 'Any of: JsonSchemaHTTPOperation, JsonSchemaPubSubOperation',
},
ignoreErrorResponses: {
type: 'boolean',
},
queryParams: {
anyOf: [
{
type: 'object',
additionalProperties: true,
},
{
type: 'string',
},
{
type: 'array',
additionalItems: true,
},
],
},
queryStringOptions: {
$ref: '#/definitions/QueryStringOptions',
},
bundlePath: {
type: 'string',
description: 'Will be removed later',
},
bundleHeaders: {
type: 'object',
properties: {},
description: 'Will be removed later',
},
timeout: {
type: 'integer',
description: 'Timeout for the HTTP request in milliseconds',
},
},
},
JsonSchemaHTTPOperation: {
additionalProperties: false,
type: 'object',
title: 'JsonSchemaHTTPOperation',
properties: {
field: {
type: 'string',
description: 'This Field based on the field name of the URL path.\nExample: "https://MyAPIURL.com/FieldNameHere/",\nso we will set the "field: FieldNameHere".',
},
description: {
type: 'string',
description: 'Your chance to describe the operation!\nMake sure the description is clear and concise.',
},
type: {
type: 'string',
enum: ['Query', 'Mutation', 'Subscription'],
description: 'Type field is set the opertion type: Query, Mutation or Subscription. (Allowed values: Query, Mutation, Subscription)',
},
requestSchema: {
anyOf: [
{
type: 'object',
additionalProperties: true,
},
{
type: 'string',
},
{
type: 'array',
additionalItems: true,
},
],
description: 'Your chance to provide request schema name.',
},
requestSample: {
anyOf: [
{
type: 'object',
additionalProperties: true,
},
{
type: 'string',
},
{
type: 'array',
additionalItems: true,
},
],
description: 'The path definition of the JSON Schema sample.\nExample: "./jsons/questions.response.json".',
},
requestTypeName: {
type: 'string',
description: 'Inset any name for the type of the request body.',
},
requestBaseBody: {
anyOf: [
{
type: 'object',
additionalProperties: true,
},
{
type: 'string',
},
{
type: 'array',
additionalItems: true,
},
],
description: 'This body will be merged with the request body sent with\nthe underlying HTTP request',
},
responseSchema: {
anyOf: [
{
type: 'object',
additionalProperties: true,
},
{
type: 'string',
},
{
type: 'array',
additionalItems: true,
},
],
description: 'Yay! Now you can provide the response schema name.',
},
responseSample: {
anyOf: [
{
type: 'object',
additionalProperties: true,
},
{
type: 'string',
},
{
type: 'array',
additionalItems: true,
},
],
description: 'Did you use Sample? Provide the response sample path.',
},
responseTypeName: {
type: 'string',
description: 'Inset any name for the type of the response body.',
},
responseByStatusCode: {
anyOf: [
{
type: 'object',
additionalProperties: true,
},
{
type: 'string',
},
{
type: 'array',
additionalItems: true,
},
],
description: 'You can define your response schemas by status codes;\n```yaml filename=".meshrc.yaml"\nresponseByStatusCode:\n 200:\n responseSchema: ./someschema.json#/somepath\n 404:\n responseSample: ./error-sample.json\n responseTypeName: MyError\n```',
},
exposeResponseMetadata: {
type: 'boolean',
description: 'Expose response details done to the upstream API\nWhen you enable this, you will see a new field in the response type;\n```graphql\ntype MyResponseType {\n myFooField: String\n _response: ResponseMetadata\n}\n\n# And a new type for the response metadata object\ntype ResponseMetadata {\n url: URL\n status: Int\n method: String\n headers: JSON\n body: String\n}\n```',
},
argTypeMap: {
type: 'object',
properties: {},
description: 'Mapping the JSON Schema and define the arguments of the operation.\n\n# Example:\nargTypeMap:\n user_id:\n type: string',
},
queryParamArgMap: {
type: 'object',
properties: {},
description: 'JSON object representing the mapping of query search parameters (added to the route path) and the matching argument.\n\n# Example:\nqueryParamArgMap:\n id: user_id',
},
path: {
type: 'string',
},
method: {
type: 'string',
enum: ['GET', 'HEAD', 'POST', 'PUT', 'DELETE', 'CONNECT', 'OPTIONS', 'TRACE', 'PATCH'],
description: 'Allowed values: GET, HEAD, POST, PUT, DELETE, CONNECT, OPTIONS, TRACE, PATCH',
},
headers: {
type: 'object',
properties: {},
},
binary: {
type: 'boolean',
description: 'If true, this operation cannot have requestSchema or requestSample\nAnd the request body will be passed as binary with its mime type\nunless you define an explicit Content-Type header',
},
},
required: ['field', 'type', 'path'],
},
JsonSchemaPubSubOperation: {
additionalProperties: false,
type: 'object',
title: 'JsonSchemaPubSubOperation',
properties: {
field: {
type: 'string',
},
description: {
type: 'string',
},
type: {
type: 'string',
enum: ['Query', 'Mutation', 'Subscription'],
description: 'Allowed values: Query, Mutation, Subscription',
},
requestSchema: {
anyOf: [
{
type: 'object',
additionalProperties: true,
},
{
type: 'string',
},
{
type: 'array',
additionalItems: true,
},
],
},
requestSample: {
anyOf: [
{
type: 'object',
additionalProperties: true,
},
{
type: 'string',
},
{
type: 'array',
additionalItems: true,
},
],
},
requestTypeName: {
type: 'string',
},
requestBaseBody: {
anyOf: [
{
type: 'object',
additionalProperties: true,
},
{
type: 'string',
},
{
type: 'array',
additionalItems: true,
},
],
description: 'This body will be merged with the request body sent with\nthe underlying HTTP request',
},
responseSchema: {
anyOf: [
{
type: 'object',
additionalProperties: true,
},
{
type: 'string',
},
{
type: 'array',
additionalItems: true,
},
],
},
responseSample: {
anyOf: [
{
type: 'object',
additionalProperties: true,
},
{
type: 'string',
},
{
type: 'array',
additionalItems: true,
},
],
},
responseTypeName: {
type: 'string',
},
argTypeMap: {
type: 'object',