@graphql-mesh/types
Version:
2,326 lines (2,322 loc) • 91 kB
JavaScript
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
/* tslint:disable */
const config = /*#__PURE__*/Object.freeze({
__proto__: null
});
var 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"
}
}
},
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"
}
]
},
customServerHandler: {
type: "string",
description: "If you want to use a custom GraphQL server, you can pass the path of the code file that exports a custom Mesh Server Handler\nWith a custom server handler, you won't be able to use the features of GraphQL Mesh HTTP Server"
},
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"
},
mock: {
$ref: "#/definitions/MockingConfig",
description: "Mock configuration for your source"
},
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
}
]
}
]
},
snapshot: {
$ref: "#/definitions/SnapshotTransformConfig",
description: "Configuration for Snapshot extension"
},
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: {
description: "Handler for JSON Schema specification.\nSource could be a local json file, or a url to it. (Any of: JsonSchemaHandler, JsonSchemaHandlerBundle)",
anyOf: [
{
$ref: "#/definitions/JsonSchemaHandler"
},
{
$ref: "#/definitions/JsonSchemaHandlerBundle"
}
]
},
mongoose: {
$ref: "#/definitions/MongooseHandler"
},
mysql: {
$ref: "#/definitions/MySQLHandler"
},
neo4j: {
$ref: "#/definitions/Neo4jHandler",
description: "Handler for Neo4j"
},
newOpenapi: {
$ref: "#/definitions/NewOpenapiHandler",
description: "Handler for Swagger / OpenAPI 2/3 specification. Source could be a local json/swagger file, or a url to it."
},
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
}
]
},
liveQuery: {
$ref: "#/definitions/LiveQueryConfig"
},
rateLimit: {
$ref: "#/definitions/RateLimitPluginConfig",
description: "RateLimit plugin"
},
responseCache: {
$ref: "#/definitions/ResponseCacheConfig"
},
webhook: {
$ref: "#/definitions/WebhookPluginConfig",
description: "Webhook plugin"
}
}
},
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: {
schema: {
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: [
"schema"
]
},
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",
"disable"
],
description: "Request Credentials if your environment supports it.\n[See more](https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials)\n\nSome environments like CF Workers don't even want to have this set.\nSo if you have problems like that. Just pass `disable` here. (Allowed values: omit, include, disable)"
},
webSocketImpl: {
type: "string",
description: "Path to a custom W3 Compatible WebSocket Implementation"
},
introspection: {
type: "string",
description: "Path to the introspection\nYou can separately give schema introspection"
},
multipart: {
type: "boolean",
description: "Enable multipart/formdata in order to support file uploads"
},
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)"
},
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"
},
protoFilePath: {
description: "gRPC Proto file that contains your protobuf schema (Any of: ProtoFilePath, String)",
anyOf: [
{
$ref: "#/definitions/ProtoFilePath"
},
{
type: "string"
}
]
},
descriptorSetFilePath: {
description: "Use 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"
},
useReflection: {
type: "boolean",
description: "Use gRPC reflection to automatically gather the connection"
},
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"
}
}
},
JsonSchemaHandlerBundle: {
additionalProperties: false,
type: "object",
title: "JsonSchemaHandlerBundle",
properties: {
bundlePath: {
anyOf: [
{
type: "object",
additionalProperties: true
},
{
type: "string"
},
{
type: "array",
additionalItems: true
}
],
description: "Path to the bundle file"
},
bundleHeaders: {
type: "object",
properties: {
},
description: "HTTP Headers to receive the bundle"
},
baseUrl: {
type: "string"
},
operationHeaders: {
type: "object",
properties: {
}
},
queryStringOptions: {
$ref: "#/definitions/QueryStringOptions"
}
},
required: [
"bundlePath"
]
},
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: {
baseUrl: {
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
}
]
},
noDeduplication: {
type: "boolean",
description: "By default, the handler will try to deduplicate the similar types to reduce the complexity of the final schema.\nYou can disable this behavior by setting this to true."
},
queryStringOptions: {
$ref: "#/definitions/QueryStringOptions"
}
},
required: [
"operations"
]
},
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\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.\nExample: 'argTypeMap: ID: String'"
},
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",
properties: {
}
},
pubsubTopic: {
type: "string"
}
},
required: [
"field",
"type",
"pubsubTopic"
]
},
MongooseHandler: {
additionalProperties: false,
type: "object",
title: "MongooseHandler",
properties: {
connectionString: {
type: "string"
},
models: {
type: "array",
items: {
$ref: "#/definitions/MongooseModel"
},
additionalItems: false
},
discriminators: {
type: "array",
items: {
$ref: "#/definitions/MongooseModel"
},
additionalItems: false
},
autoTypeMerging: {
type: "boolean",
description: "Enable Automatic Type Merging/Federation support"
}
}
},
MongooseModel: {
additionalProperties: false,
type: "object",
title: "MongooseModel",
properties: {
name: {
type: "string"
},
path: {
type: "string"
},
options: {
$ref: "#/definitions/ComposeWithMongooseOpts"
}
},
required: [
"name",
"path"
]
},
ComposeWithMongooseOpts: {
additionalProperties: false,
type: "object",
title: "ComposeWithMongooseOpts",
properties: {
name: {
type: "string"
},
description: {
type: "string"
},
fields: {
$ref: "#/definitions/ComposeWithMongooseFieldsOpts"
},
inputType: {
$ref: "#/definitions/ComposeMongooseInputType"
},
resolvers: {
$ref: "#/definitions/TypeConverterResolversOpts"
}
}
},
ComposeMongooseInputType: {
additionalProperties: false,
type: "object",
title: "ComposeMongooseInputType",
properties: {
name: {
type: "string"
},
description: {
type: "string"
},
fields: {
$ref: "#/definitions/ComposeWithMongooseFieldsOpts"
},
resolvers: {
$ref: "#/definitions/TypeConverterResolversOpts"
}
}
},
ComposeWithMongooseFieldsOpts: {
additionalProperties: false,
type: "object",
title: "ComposeWithMongooseFieldsOpts",
properties: {
only: {
type: "array",
items: {
type: "string"
},
additionalItems: false
},
remove: {
type: "array",
items: {
type: "string"
},
additionalItems: false
},
required: {
type: "array",
items: {
type: "string"
},
additionalItems: false
}
}
},
TypeConverterResolversOpts: {
additionalProperties: false,
type: "object",
title: "TypeConverterResolversOpts",
properties: {
findById: {
description: "Any of: Boolean, ComposeWithMongooseResolverOpts",
anyOf: [
{
type: "boolean"
},
{
$ref: "#/definitions/ComposeWithMongooseResolverOpts"
}
]
},
findByIds: {
description: "Any of: Boolean, ComposeWithMongooseResolverOpts",
anyOf: [
{
type: "boolean"
},
{
$ref: "#/definitions/ComposeWithMongooseResolverOpts"
}
]
},
findOne: {
description: "Any of: Boolean, ComposeWithMongooseResolverOpts",
anyOf: [
{
type: "boolean"
},
{
$ref: "#/definitions/ComposeWithMongooseResolverOpts"
}
]
},
findMany: {
description: "Any of: Boolean, ComposeWithMongooseResolverOpts",
anyOf: [
{
type: "boolean"
},
{
$ref: "#/definitions/ComposeWithMongooseResolverOpts"
}
]
},
updateById: {
description: "Any of: Boolean, ComposeWithMongooseResolverOpts",
anyOf: [
{
type: "boolean"
},
{
$ref: "#/definitions/ComposeWithMongooseResolverOpts"
}
]
},
updateOne: {
description: "Any of: Boolean, ComposeWithMongooseResolverOpts",
anyOf: [
{
type: "boolean"
},
{
$ref: "#/definitions/ComposeWithMongooseResolverOpts"
}
]
},
updateMany: {
description: "Any of: Boolean, ComposeWithMongooseResolverOpts",
anyOf: [
{
type: "boolean"
},
{
$ref: "#/definitions/ComposeWithMongooseResolverOpts"
}
]
},
removeById: {
description: "Any of: Boolean, ComposeWithMongooseResolverOpts",
anyOf: [
{
type: "boolean"
},
{
$ref: "#/definitions/ComposeWithMongooseResolverOpts"
}
]
},
removeOne: {
description: "Any of: Boolean, ComposeWithMongooseResolverOpts",
anyOf: [
{
type: "boolean"
},
{
$ref: "#/definitions/ComposeWithMongooseResolverOpts"
}
]
},
removeMany: {
description: "Any of: Boolean, ComposeWithMongooseResolverOpts",
anyOf: [
{
type: "boolean"
},
{
$ref: "#/definitions/ComposeWithMongooseResolverOpts"
}
]
},
createOne: {
description: "Any of: Boolean, ComposeWithMongooseResolverOpts",
anyOf: [
{
type: "boolean"
},
{
$ref: "#/definitions/ComposeWithMongooseResolverOpts"
}
]
},
createMany: {
description: "Any of: Boolean, ComposeWithMongooseResolverOpts",
anyOf: [
{
type: "boolean"
},
{
$ref: "#/definitions/ComposeWithMongooseResolverOpts"
}
]
},
count: {
description: "Any of: Boolean, ComposeWithMongooseResolverOpts",
anyOf: [
{
type: "boolean"
},
{
$ref: "#/definitions/ComposeWithMongooseResolverOpts"
}
]
},
connection: {
description: "Any of: Boolean, JSON",
anyOf: [
{
type: "boolean"
},
{
type: "object",
properties: {
}
}
]
},
pagination: {
description: "Any of: Boolean, PaginationResolverOpts",
anyOf: [
{
type: "boolean"
},
{
$ref: "#/definitions/PaginationResolverOpts"
}
]
}
}
},
ComposeWithMongooseResolverOpts: {
additionalProperties: false,
type: "object",
title: "ComposeWithMongooseResolverOpts",
properties: {
filter: {
$ref: "#/definitions/FilterHelperArgsOpts"
},
sort: {
$ref: "#/definitions/SortHelperArgsOpts"
},
limit: {
$ref: "#/definitions/LimitHelperArgsOpts"
},
record: {
$ref: "#/definitions/RecordHelperArgsOpts"
},
skip: {
type: "boolean"
}
}
},
FilterHelperArgsOpts: {
additionalProperties: false,
type: "object",
title: "FilterHelperArgsOpts",
properties: {
filterTypeName: {
type: "string"
},
isRequired: {
type: "boolean"
},
onlyIndexed: {
type: "boolean"
},
requiredFields: {
type: "array",
items: {
type: "string"
},
additionalItems: false
},
operators: {
description: "Any of: Boolean, JSON",
anyOf: [
{
type: "boolean"
},
{
type: "object",
properties: {
}
}
]
},
removeFields: {
type: "array",
items: {
type: "string"
},
additionalItems: false
}
}
},
SortHelperArgsOpts: {
additionalProperties: false,
type: "object",
title: "SortHelperArgsOpts",
properties: {
sortTypeName: {
type: "string"
}
}
},
LimitHelperArgsOpts: {
additionalProperties: false,
type: "object",
title: "LimitHelperArgsOpts",
properties: {
defaultValue: {
type: "integer"
}
}
},
RecordHelperArgsOpts: {
additionalProperties: false,
type: "object",
title: "RecordHelperArgsOpts",
properties: {
recordTypeName: {
type: "string"
},
isRequired: {
type: "boolean"
},
removeFields: {
type: "array",
items: {
type: "string"
},
additionalItems: false
},
requiredFields: {
type: "array",
items: {
type: "string"
},
additionalItems: false
}
}
},
PaginationResolverOpts: {
additionalProperties: false,
type: "object",
title: "PaginationResolverOpts",
properties: {
perPage: {
type: "integer"
}
}
},
MySQLHandler: {
additionalProperties: false,
type: "object",
title: "MySQLHandler",
properties: {
host: {
type: "string"
},
port: {
type: "integer"
},
user: {
type: "string"
},
password: {
type: "string"
},
database: {
type: "string"
},
pool: {
anyOf: [
{
type: "object",
additionalProperties: true
},
{
type: "string"
},
{
type: "array",
additionalItems: true
}
],
description: "Use existing `Pool` instance\nFormat: modulePath#exportName"
},
tables: {
type: "array",
items: {
type: "string"
},
additionalItems: false,
description: "Use specific tables for your schema"
},
tableFields: {
type: "array",
items: {
$ref: "#/definitions/TableField"
},
additionalItems: false,
description: "Use specific fields of specific tables"
}
}
},
TableField: {
additionalProperties: false,
type: "object",
title: "TableField",
properties: {
table: {
type: "string"
},
fields: {
type: "array",
items: {
type: "string"
},
additionalItems: false
}
},
required: [
"table",
"fields"
]
},
Neo4jHandler: {
additionalProperties: false,
type: "object",
title: "Neo4jHandler",
properties: {
url: {
type: "string",
description: "URL for the Neo4j Instance e.g. neo4j://localhost"
},
username: {
type: "string",
description: "Username for basic authentication"
},
password: {
type: "string",
description: "Password for basic authentication"
},
alwaysIncludeRelationships: {
type: "boolean",
description: "Specifies whether relationships should always be included in the type definitions as [relationship](https://grandstack.io/docs/neo4j-graphql-js.html#relationship-types) types, even if the relationships do not have properties."
},
database: {
type: "string",
description: "Specifies database name"
},
typeDefs: {
type: "string",
description: "Provide GraphQL Type Definitions instead of inferring"
}
},
required: [
"url",
"username",
"password"
]
},
NewOpenapiHandler: {
additionalProperties: false,
type: "object",
title: "NewOpenapiHandler",
properties: {
oasFilePath: {
type: "string"
},
fallbackFormat: {
type: "string",
"enum": [
"json",
"yaml",
"js",
"ts"
],
description: "Allowed values: json, yaml, js, ts"
},
baseUrl: {
type: "string"
},
schemaHeaders: {
type: "object",
properties: {
}
},
operationHeaders: {
type: "object",
properties: {
}
},
ignoreErrorResponses: {
type: "boolean"
},
selectQueryOrMutationField: {
type: "array",
items: {
$ref: "#/definitions/OASSelectQueryOrMutationFieldConfig"
},
additionalItems: false
},
queryParams: {
anyOf: [
{
type: "object",
additionalProperties: true
},
{
type: "string"
},
{
type: "array",
additionalItems: true
}
]
}
},
required: [
"oasFilePath"
]
},
OASSelectQueryOrMutationFieldConfig: {
additionalProperties: false,
type: "object",
title: "OASSelectQueryOrMutationFieldConfig",
properties: {
type: {
type: "string",
"enum": [
"query",
"mutation",
"Query",
"Mutation"
],
description: "Allowed values: query, mutation, Query, Mutation"
},
fieldName: {
type: "string"
}
},
required: [
"type",
"fieldName"
]
},
ODataHandler: {
additionalProperties: false,
type: "object",
title: "ODataHandler",
properties: {
baseUrl: {
type: "string",
description: "Base URL for OData API"
},
metadata: {
type: "string",
description: "Custom $metadata File or URL"
},
operationHeaders: {
type: "object",
properties: {
},
description: "Headers to be used with the operation requests"
},
schemaHeaders: {
type: "object",
properties: {
},
description: "Headers to be used with the $metadata requests"
},
batch: {
type: "string",
"enum": [
"multipart",
"json"
],
description: "Enable batching (Allowed values: multipart, json)"
},
expandNavProps: {
type: "boolean",
description: "Use $expand for navigation props instead of seperate HTTP requests (Default: false)"
}
},
required: [
"baseUrl"
]
},
OpenapiHandler: {
additionalProperties: false,
type: "object",
title: "OpenapiHandler",
properties: {
source: {
anyOf: [
{
type: "object",
additionalProperties: true
},
{
type: "string"
},
{
type: "array",
additionalItems: true
}
],
description: "A pointer to your API source - could be a local file, remote file or url endpoint"
},
sourceFormat: {
type: "string",
"enum": [
"json",
"yaml"
],
description: "Format of the source file (Allowed values: json, yaml)"
},
operationHeaders: {
type: "object",
properties: {
},
description: "JSON object representing the Headers to add to the runtime of the API calls"
},
schemaHeaders: {
type: "object",
properties: {
},
description: "If you are using a remote URL endpoint to fetch your schema, you can set headers for the HTTP request to fetch your schema."
},
baseUrl: {
type: "string",
description: "Specifies the URL on which all paths will be based on.\nOverrides the server object in the OAS."
},
qs: {
type: "object",
properties: {
},
description: "JSON object representing the query search parameters to add to the API calls"
},
includeHttpDetails: {
type: "boolean",
description: "Include HTTP Response details to the result object"
},
addLimitArgument: {
type: "boolean",
description: "Auto-generate a 'limit' argument for all fields that return lists of objects, including ones produced by links"
},
genericPayloadArgName: {
type: "boolean",
description: "Set argument name for mutation payload to 'requestBody'. If false, name defaults to camelCased pathname"
},
selectQueryOrMutationField: {
type: "array",
items: {
$ref: "#/definitions/SelectQueryOrMutationFieldConfig"
},
additionalItems: false,
description: "Allows to explicitly override the default operation (Query or Mutation) for any OAS operation"
},
provideErrorExtensions: {
type: "boolean",
description: "Overwrite automatic wrapping of errors into GraphqlErrors"
},
operationIdFieldNames: {
type: "boolean",
description: "Field names can only be sanitized operationIds\nBy default, query field names are based on the return type type name and mutation field names are based on the operationId, which may be generated if it does not exist.\nThis option forces OpenAPI handler to only create field names based on the operationId."
},
allowUndefinedSchemaRefTags: {
type: "boolean",
description: "Allow processing to continue if the swagger schema is missing a schema $ref."
},
defaultUndefinedSchemaType: {
type: "string",
"enum": [
"string",
"number",
"object",
"array",
"boolean",
"integer"
],
description: "Object type to use for missing swagger schemas refs default is object. (Allowed values: string, number, object, array, boolean, integer)"
}
},
required: [
"source"
]
},
SelectQueryOrMutationFieldConfig: {
additionalProperties: false,
type: "object",
title: "SelectQueryOrMutationFieldConfig",
properties: {
title: {
type: "string",
description: "OAS Title"
},
path: {
type: "string",
description: "Operation Path"
},
type: {
type: "string",
"enum": [
"query",
"mutation",
"Query",
"Mutation"
],
description: "Target Root Type for this operation (Allowed values: query, mutation, Query, Mutation)"
},
method: {
type: "string",
description: "Which method is used for this operation"
}
}
},
LiveQueryConfig: {
additionalProperties: false,
type: "object",
title: "LiveQueryConfig",
properties: {
invalidations: {
type: "array",
items: {
$ref: "#/definitions/LiveQueryInvalidation"
},
additionalItems: false,
description: "Invalidate a query or queries when a specific operation is done without an error"
},
polling: {
type: "array",
items: {
$ref: "#/definitions/LiveQueryPolling"
},
additionalItems: false,
description: "Allow an operation can be used a live query with polling"
}
}
},
LiveQueryInvalidation: {
additionalProperties: false,
type: "object",
title: "LiveQueryInvalidation",
properties: {
field: {
type: "string",
description: "Path to the operation that could effect it. In a form: Mutation.something. Note that wildcard is not supported in this field."
},
invalidate: {
type: "array",
items: {
type: "string"
},
additionalItems: false
}
},
required: [
"field",
"invalidate"
]
},
LiveQueryPolling: {
additionalProperties: false,
type: "object",
title: "LiveQueryPolling",
properties: {
interval: {
type: "integer"
},
invalidate: {
type: "array",
items: {
type: "string"
},
additionalItems: false
}
},
required: [
"interval",
"invalidate"
]
},
RateLimitPluginConfig: {
additionalProperties: false,
type: "object",
title: "RateLimitPluginConfig",
properties: {
config: {
type: "array",
items: {
$ref: "#/definitions/RateLimitTransformConfig"
},
additionalItems: false
}
},
required: [
"config"
]
},
ResponseCacheConfig: {
additionalProperties: false,
type: "object",
title: "ResponseCacheConfig",
properties: {
ttl: {
type: "number",
description: "Maximum age in ms. Defaults to `Infinity`. Set it to 0 for disabling the global TTL."
},
ttlPerCoordinate: {
type: "array",
items: {
$ref: "#/definitions/ResponseCacheTTLConfig"
},
additionalItems: false,
description: "Overwrite the ttl for query operations whose selection contains a specific schema coordinate (e.g. Query.users).\nUseful if the selection of a specific field should reduce the TTL of the query operation."
},
ignoredTypes: {
type: "array",
items: {
type: "string"
},
additionalItems: false,
description: "Skip caching of following the types."
},
idFields: {
type: "array",
items: {
type: "string"
},
additionalItems: false,
description: "List of fields that are used to identify the entity."
},
invalidateViaMutation: {
type: "boolean",
description: "Whether the mutation execution result should be used for invalidating resources.\nDefaults to `true`"
},
includeExtensionMetadata: {
type: "boolean",
description: "Include extension values that provide useful information, such as whether the cache was hit or which resources a mutation invalidated."
},
sessionId: {
type: "string",
description: "Allows to cache responses based on the resolved session id.\nReturn a unique value for each session.\nCreates a global session by default.\nExample;\n```yaml\nsessionId: \"{context.headers.userId}\"\n```"
},
"if": {
type: "string",
descripti