@hasura/ndc-sdk-typescript
Version:
This SDK is mostly analogous to the Rust SDK, except where necessary.
1,910 lines (1,909 loc) • 96.4 kB
JSON
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "SchemaRoot",
"type": "object",
"required": [
"capabilities_response",
"error_response",
"explain_response",
"mutation_request",
"mutation_response",
"query_request",
"query_response",
"schema_response",
"validate_response"
],
"properties": {
"capabilities_response": {
"$ref": "#/definitions/CapabilitiesResponse"
},
"schema_response": {
"$ref": "#/definitions/SchemaResponse"
},
"query_request": {
"$ref": "#/definitions/QueryRequest"
},
"query_response": {
"$ref": "#/definitions/QueryResponse"
},
"mutation_request": {
"$ref": "#/definitions/MutationRequest"
},
"mutation_response": {
"$ref": "#/definitions/MutationResponse"
},
"explain_response": {
"$ref": "#/definitions/ExplainResponse"
},
"error_response": {
"$ref": "#/definitions/ErrorResponse"
},
"validate_response": {
"$ref": "#/definitions/ValidateResponse"
}
},
"definitions": {
"CapabilitiesResponse": {
"title": "Capabilities Response",
"type": "object",
"required": [
"capabilities",
"version"
],
"properties": {
"version": {
"type": "string"
},
"capabilities": {
"$ref": "#/definitions/Capabilities"
}
}
},
"Capabilities": {
"title": "Capabilities",
"description": "Describes the features of the specification which a data connector implements.",
"type": "object",
"required": [
"mutation",
"query"
],
"properties": {
"query": {
"$ref": "#/definitions/QueryCapabilities"
},
"mutation": {
"$ref": "#/definitions/MutationCapabilities"
},
"relationships": {
"anyOf": [
{
"$ref": "#/definitions/RelationshipCapabilities"
},
{
"type": "null"
}
]
}
}
},
"QueryCapabilities": {
"title": "Query Capabilities",
"type": "object",
"properties": {
"aggregates": {
"description": "Does the connector support aggregate queries",
"anyOf": [
{
"$ref": "#/definitions/AggregateCapabilities"
},
{
"type": "null"
}
]
},
"variables": {
"description": "Does the connector support queries which use variables",
"anyOf": [
{
"$ref": "#/definitions/LeafCapability"
},
{
"type": "null"
}
]
},
"explain": {
"description": "Does the connector support explaining queries",
"anyOf": [
{
"$ref": "#/definitions/LeafCapability"
},
{
"type": "null"
}
]
},
"nested_fields": {
"description": "Does the connector support nested fields",
"default": {},
"allOf": [
{
"$ref": "#/definitions/NestedFieldCapabilities"
}
]
},
"exists": {
"description": "Does the connector support EXISTS predicates",
"default": {},
"allOf": [
{
"$ref": "#/definitions/ExistsCapabilities"
}
]
}
}
},
"AggregateCapabilities": {
"title": "Aggregate Capabilities",
"type": "object",
"properties": {
"filter_by": {
"description": "Does the connector support filtering based on aggregated values",
"anyOf": [
{
"$ref": "#/definitions/LeafCapability"
},
{
"type": "null"
}
]
},
"group_by": {
"description": "Does the connector support aggregations over groups",
"anyOf": [
{
"$ref": "#/definitions/GroupByCapabilities"
},
{
"type": "null"
}
]
}
}
},
"LeafCapability": {
"description": "A unit value to indicate a particular leaf capability is supported. This is an empty struct to allow for future sub-capabilities.",
"type": "object"
},
"GroupByCapabilities": {
"title": "Group By Capabilities",
"type": "object",
"properties": {
"filter": {
"description": "Does the connector support post-grouping predicates",
"anyOf": [
{
"$ref": "#/definitions/LeafCapability"
},
{
"type": "null"
}
]
},
"order": {
"description": "Does the connector support post-grouping ordering",
"anyOf": [
{
"$ref": "#/definitions/LeafCapability"
},
{
"type": "null"
}
]
},
"paginate": {
"description": "Does the connector support post-grouping pagination",
"anyOf": [
{
"$ref": "#/definitions/LeafCapability"
},
{
"type": "null"
}
]
}
}
},
"NestedFieldCapabilities": {
"title": "Nested Field Capabilities",
"type": "object",
"properties": {
"filter_by": {
"description": "Does the connector support filtering by values of nested fields",
"anyOf": [
{
"$ref": "#/definitions/NestedFieldFilterByCapabilities"
},
{
"type": "null"
}
]
},
"order_by": {
"description": "Does the connector support ordering by values of nested fields",
"anyOf": [
{
"$ref": "#/definitions/LeafCapability"
},
{
"type": "null"
}
]
},
"aggregates": {
"description": "Does the connector support aggregating values within nested fields",
"anyOf": [
{
"$ref": "#/definitions/LeafCapability"
},
{
"type": "null"
}
]
},
"nested_collections": {
"description": "Does the connector support nested collection queries using `NestedField::NestedCollection`",
"anyOf": [
{
"$ref": "#/definitions/LeafCapability"
},
{
"type": "null"
}
]
}
}
},
"NestedFieldFilterByCapabilities": {
"title": "Nested Field Filter By Capabilities",
"type": "object",
"properties": {
"nested_arrays": {
"description": "Does the connector support filtering over nested arrays (ie. Expression::ArrayComparison)",
"anyOf": [
{
"$ref": "#/definitions/NestedArrayFilterByCapabilities"
},
{
"type": "null"
}
]
}
}
},
"NestedArrayFilterByCapabilities": {
"title": "Nested Array Filter By Capabilities",
"type": "object",
"properties": {
"contains": {
"description": "Does the connector support filtering over nested arrays by checking if the array contains a value. This must be supported for all types that can be contained in an array that implement an 'eq' comparison operator.",
"anyOf": [
{
"$ref": "#/definitions/LeafCapability"
},
{
"type": "null"
}
]
},
"is_empty": {
"description": "Does the connector support filtering over nested arrays by checking if the array is empty. This must be supported no matter what type is contained in the array.",
"anyOf": [
{
"$ref": "#/definitions/LeafCapability"
},
{
"type": "null"
}
]
}
}
},
"ExistsCapabilities": {
"title": "Exists Capabilities",
"type": "object",
"properties": {
"named_scopes": {
"description": "Does the connector support named scopes in column references inside EXISTS predicates",
"anyOf": [
{
"$ref": "#/definitions/LeafCapability"
},
{
"type": "null"
}
]
},
"unrelated": {
"description": "Does the connector support ExistsInCollection::Unrelated",
"anyOf": [
{
"$ref": "#/definitions/LeafCapability"
},
{
"type": "null"
}
]
},
"nested_collections": {
"description": "Does the connector support ExistsInCollection::NestedCollection",
"anyOf": [
{
"$ref": "#/definitions/LeafCapability"
},
{
"type": "null"
}
]
},
"nested_scalar_collections": {
"description": "Does the connector support filtering over nested scalar arrays using existential quantification. This means the connector must support ExistsInCollection::NestedScalarCollection.",
"anyOf": [
{
"$ref": "#/definitions/LeafCapability"
},
{
"type": "null"
}
]
}
}
},
"MutationCapabilities": {
"title": "Mutation Capabilities",
"type": "object",
"properties": {
"transactional": {
"description": "Does the connector support executing multiple mutations in a transaction.",
"anyOf": [
{
"$ref": "#/definitions/LeafCapability"
},
{
"type": "null"
}
]
},
"explain": {
"description": "Does the connector support explaining mutations",
"anyOf": [
{
"$ref": "#/definitions/LeafCapability"
},
{
"type": "null"
}
]
}
}
},
"RelationshipCapabilities": {
"title": "Relationship Capabilities",
"type": "object",
"properties": {
"relation_comparisons": {
"description": "Does the connector support comparisons that involve related collections (ie. joins)?",
"anyOf": [
{
"$ref": "#/definitions/LeafCapability"
},
{
"type": "null"
}
]
},
"order_by_aggregate": {
"description": "Does the connector support ordering by an aggregated array relationship?",
"anyOf": [
{
"$ref": "#/definitions/LeafCapability"
},
{
"type": "null"
}
]
},
"nested": {
"description": "Does the connector support navigating a relationship from inside a nested object",
"anyOf": [
{
"$ref": "#/definitions/NestedRelationshipCapabilities"
},
{
"type": "null"
}
]
}
}
},
"NestedRelationshipCapabilities": {
"title": "Nested Relationship Capabilities",
"type": "object",
"properties": {
"array": {
"description": "Does the connector support navigating a relationship from inside a nested object inside a nested array",
"anyOf": [
{
"$ref": "#/definitions/LeafCapability"
},
{
"type": "null"
}
]
},
"filtering": {
"description": "Does the connector support filtering over a relationship that starts from inside a nested object",
"anyOf": [
{
"$ref": "#/definitions/LeafCapability"
},
{
"type": "null"
}
]
},
"ordering": {
"description": "Does the connector support ordering over a relationship that starts from inside a nested object",
"anyOf": [
{
"$ref": "#/definitions/LeafCapability"
},
{
"type": "null"
}
]
}
}
},
"SchemaResponse": {
"title": "Schema Response",
"type": "object",
"required": [
"collections",
"functions",
"object_types",
"procedures",
"scalar_types"
],
"properties": {
"scalar_types": {
"description": "A list of scalar types which will be used as the types of collection columns",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/ScalarType"
}
},
"object_types": {
"description": "A list of object types which can be used as the types of arguments, or return types of procedures. Names should not overlap with scalar type names.",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/ObjectType"
}
},
"collections": {
"description": "Collections which are available for queries",
"type": "array",
"items": {
"$ref": "#/definitions/CollectionInfo"
}
},
"functions": {
"description": "Functions (i.e. collections which return a single column and row)",
"type": "array",
"items": {
"$ref": "#/definitions/FunctionInfo"
}
},
"procedures": {
"description": "Procedures which are available for execution as part of mutations",
"type": "array",
"items": {
"$ref": "#/definitions/ProcedureInfo"
}
},
"capabilities": {
"description": "Schema data which is relevant to features enabled by capabilities",
"anyOf": [
{
"$ref": "#/definitions/CapabilitySchemaInfo"
},
{
"type": "null"
}
]
}
}
},
"ScalarType": {
"title": "Scalar Type",
"description": "The definition of a scalar type, i.e. types that can be used as the types of columns.",
"type": "object",
"required": [
"aggregate_functions",
"comparison_operators",
"representation"
],
"properties": {
"representation": {
"description": "A description of valid values for this scalar type.",
"allOf": [
{
"$ref": "#/definitions/TypeRepresentation"
}
]
},
"aggregate_functions": {
"description": "A map from aggregate function names to their definitions. Result type names must be defined scalar types declared in ScalarTypesCapabilities.",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/AggregateFunctionDefinition"
}
},
"comparison_operators": {
"description": "A map from comparison operator names to their definitions. Argument type names must be defined scalar types declared in ScalarTypesCapabilities.",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/ComparisonOperatorDefinition"
}
},
"extraction_functions": {
"description": "A map from extraction function names to their definitions.",
"default": {},
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/ExtractionFunctionDefinition"
}
}
}
},
"TypeRepresentation": {
"title": "Type Representation",
"description": "Representations of scalar types",
"oneOf": [
{
"description": "JSON booleans",
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"boolean"
]
}
}
},
{
"description": "Any JSON string",
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"string"
]
}
}
},
{
"description": "A 8-bit signed integer with a minimum value of -2^7 and a maximum value of 2^7 - 1",
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"int8"
]
}
}
},
{
"description": "A 16-bit signed integer with a minimum value of -2^15 and a maximum value of 2^15 - 1",
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"int16"
]
}
}
},
{
"description": "A 32-bit signed integer with a minimum value of -2^31 and a maximum value of 2^31 - 1",
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"int32"
]
}
}
},
{
"description": "A 64-bit signed integer with a minimum value of -2^63 and a maximum value of 2^63 - 1",
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"int64"
]
}
}
},
{
"description": "An IEEE-754 single-precision floating-point number",
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"float32"
]
}
}
},
{
"description": "An IEEE-754 double-precision floating-point number",
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"float64"
]
}
}
},
{
"description": "Arbitrary-precision integer string",
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"biginteger"
]
}
}
},
{
"description": "Arbitrary-precision decimal string",
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"bigdecimal"
]
}
}
},
{
"description": "UUID string (8-4-4-4-12)",
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"uuid"
]
}
}
},
{
"description": "ISO 8601 date",
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"date"
]
}
}
},
{
"description": "ISO 8601 timestamp",
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"timestamp"
]
}
}
},
{
"description": "ISO 8601 timestamp-with-timezone",
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"timestamptz"
]
}
}
},
{
"description": "GeoJSON, per RFC 7946",
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"geography"
]
}
}
},
{
"description": "GeoJSON Geometry object, per RFC 7946",
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"geometry"
]
}
}
},
{
"description": "Base64-encoded bytes",
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"bytes"
]
}
}
},
{
"description": "Arbitrary JSON",
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"json"
]
}
}
},
{
"description": "One of the specified string values",
"type": "object",
"required": [
"one_of",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"enum"
]
},
"one_of": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
]
},
"AggregateFunctionDefinition": {
"title": "Aggregate Function Definition",
"description": "The definition of an aggregation function on a scalar type",
"oneOf": [
{
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"min"
]
}
}
},
{
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"max"
]
}
}
},
{
"type": "object",
"required": [
"result_type",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"sum"
]
},
"result_type": {
"description": "The scalar type of the result of this function, which should have one of the type representations Int64 or Float64, depending on whether this function is defined on a scalar type with an integer or floating-point representation, respectively.",
"type": "string"
}
}
},
{
"type": "object",
"required": [
"result_type",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"average"
]
},
"result_type": {
"description": "The scalar type of the result of this function, which should have the type representation Float64",
"type": "string"
}
}
},
{
"type": "object",
"required": [
"result_type",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"custom"
]
},
"result_type": {
"description": "The scalar or object type of the result of this function",
"allOf": [
{
"$ref": "#/definitions/Type"
}
]
}
}
}
]
},
"Type": {
"title": "Type",
"description": "Types track the valid representations of values as JSON",
"oneOf": [
{
"description": "A named type",
"type": "object",
"required": [
"name",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"named"
]
},
"name": {
"description": "The name can refer to a scalar or object type",
"type": "string"
}
}
},
{
"description": "A nullable type",
"type": "object",
"required": [
"type",
"underlying_type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"nullable"
]
},
"underlying_type": {
"description": "The type of the non-null inhabitants of this type",
"allOf": [
{
"$ref": "#/definitions/Type"
}
]
}
}
},
{
"description": "An array type",
"type": "object",
"required": [
"element_type",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"array"
]
},
"element_type": {
"description": "The type of the elements of the array",
"allOf": [
{
"$ref": "#/definitions/Type"
}
]
}
}
},
{
"description": "A predicate type for a given object type",
"type": "object",
"required": [
"object_type_name",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"predicate"
]
},
"object_type_name": {
"description": "The object type name",
"type": "string"
}
}
}
]
},
"ComparisonOperatorDefinition": {
"title": "Comparison Operator Definition",
"description": "The definition of a comparison operator on a scalar type",
"oneOf": [
{
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"equal"
]
}
}
},
{
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"in"
]
}
}
},
{
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"less_than"
]
}
}
},
{
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"less_than_or_equal"
]
}
}
},
{
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"greater_than"
]
}
}
},
{
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"greater_than_or_equal"
]
}
}
},
{
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"contains"
]
}
}
},
{
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"contains_insensitive"
]
}
}
},
{
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"starts_with"
]
}
}
},
{
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"starts_with_insensitive"
]
}
}
},
{
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"ends_with"
]
}
}
},
{
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"ends_with_insensitive"
]
}
}
},
{
"type": "object",
"required": [
"argument_type",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"custom"
]
},
"argument_type": {
"description": "The type of the argument to this operator",
"allOf": [
{
"$ref": "#/definitions/Type"
}
]
}
}
}
]
},
"ExtractionFunctionDefinition": {
"title": "Extraction Function Definition",
"description": "The definition of an aggregation function on a scalar type",
"oneOf": [
{
"type": "object",
"required": [
"result_type",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"nanosecond"
]
},
"result_type": {
"description": "The result type, which must be a defined scalar type in the schema response.",
"type": "string"
}
}
},
{
"type": "object",
"required": [
"result_type",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"microsecond"
]
},
"result_type": {
"description": "The result type, which must be a defined scalar type in the schema response.",
"type": "string"
}
}
},
{
"type": "object",
"required": [
"result_type",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"second"
]
},
"result_type": {
"description": "The result type, which must be a defined scalar type in the schema response.",
"type": "string"
}
}
},
{
"type": "object",
"required": [
"result_type",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"minute"
]
},
"result_type": {
"description": "The result type, which must be a defined scalar type in the schema response.",
"type": "string"
}
}
},
{
"type": "object",
"required": [
"result_type",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"hour"
]
},
"result_type": {
"description": "The result type, which must be a defined scalar type in the schema response.",
"type": "string"
}
}
},
{
"type": "object",
"required": [
"result_type",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"day"
]
},
"result_type": {
"description": "The result type, which must be a defined scalar type in the schema response.",
"type": "string"
}
}
},
{
"type": "object",
"required": [
"result_type",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"week"
]
},
"result_type": {
"description": "The result type, which must be a defined scalar type in the schema response.",
"type": "string"
}
}
},
{
"type": "object",
"required": [
"result_type",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"month"
]
},
"result_type": {
"description": "The result type, which must be a defined scalar type in the schema response.",
"type": "string"
}
}
},
{
"type": "object",
"required": [
"result_type",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"quarter"
]
},
"result_type": {
"description": "The result type, which must be a defined scalar type in the schema response.",
"type": "string"
}
}
},
{
"type": "object",
"required": [
"result_type",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"year"
]
},
"result_type": {
"description": "The result type, which must be a defined scalar type in the schema response.",
"type": "string"
}
}
},
{
"type": "object",
"required": [
"result_type",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"day_of_week"
]
},
"result_type": {
"description": "The result type, which must be a defined scalar type in the schema response.",
"type": "string"
}
}
},
{
"type": "object",
"required": [
"result_type",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"day_of_year"
]
},
"result_type": {
"description": "The result type, which must be a defined scalar type in the schema response.",
"type": "string"
}
}
},
{
"type": "object",
"required": [
"result_type",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"custom"
]
},
"result_type": {
"description": "The scalar or object type of the result of this function",
"allOf": [
{
"$ref": "#/definitions/Type"
}
]
}
}
}
]
},
"ObjectType": {
"title": "Object Type",
"description": "The definition of an object type",
"type": "object",
"required": [
"fields",
"foreign_keys"
],
"properties": {
"description": {
"description": "Description of this type",
"type": [
"string",
"null"
]
},
"fields": {
"description": "Fields defined on this object type",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/ObjectField"
}
},
"foreign_keys": {
"description": "Any foreign keys defined for this object type's columns",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/ForeignKeyConstraint"
}
}
}
},
"ObjectField": {
"title": "Object Field",
"description": "The definition of an object field",
"type": "object",
"required": [
"type"
],
"properties": {
"description": {
"description": "Description of this field",
"type": [
"string",
"null"
]
},
"type": {
"description": "The type of this field",
"allOf": [
{
"$ref": "#/definitions/Type"
}
]
},
"arguments": {
"description": "The arguments available to the field - Matches implementation from CollectionInfo",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/ArgumentInfo"
}
}
}
},
"ArgumentInfo": {
"title": "Argument Info",
"type": "object",
"required": [
"type"
],
"properties": {
"description": {
"description": "Argument description",
"type": [
"string",
"null"
]
},
"type": {
"description": "The name of the type of this argument",
"allOf": [
{
"$ref": "#/definitions/Type"
}
]
}
}
},
"ForeignKeyConstraint": {
"title": "Foreign Key Constraint",
"type": "object",
"required": [
"column_mapping",
"foreign_collection"
],
"properties": {
"column_mapping": {
"description": "The columns on which you want want to define the foreign key. This is a mapping between fields on object type to columns on the foreign collection. The column on the foreign collection is specified via a field path (ie. an array of field names that descend through nested object fields). The field path must only contain a single item, meaning a column on the foreign collection's type, unless the 'relationships.nested' capability is supported, in which case multiple items can be used to denote a nested object field.",
"type": "object",
"additionalProperties": {
"type": "array",
"items": {
"type": "string"
}
}
},
"foreign_collection": {
"description": "The name of a collection",
"type": "string"
}
}
},
"CollectionInfo": {
"title": "Collection Info",
"type": "object",
"required": [
"arguments",
"name",
"type",
"uniqueness_constraints"
],
"properties": {
"name": {
"description": "The name of the collection\n\nNote: these names are abstract - there is no requirement that this name correspond to the name of an actual collection in the database.",
"type": "string"
},
"description": {
"description": "Description of the collection",
"type": [
"string",
"null"
]
},
"arguments": {
"description": "Any arguments that this collection requires",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/ArgumentInfo"
}
},
"type": {
"description": "The name of the collection's object type",
"type": "string"
},
"uniqueness_constraints": {
"description": "Any uniqueness constraints enforced on this collection",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/UniquenessConstraint"
}
}
}
},
"UniquenessConstraint": {
"title": "Uniqueness Constraint",
"type": "object",
"required": [
"unique_columns"
],
"properties": {
"unique_columns": {
"description": "A list of columns which this constraint requires to be unique",
"type": "array",
"items": {
"type": "string"
}
}
}
},
"FunctionInfo": {
"title": "Function Info",
"type": "object",
"required": [
"arguments",
"name",
"result_type"
],
"properties": {
"name": {
"description": "The name of the function",
"type": "string"
},
"description": {
"description": "Description of the function",
"type": [
"string",
"null"
]
},
"arguments": {
"description": "Any arguments that this collection requires",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/ArgumentInfo"
}
},
"result_type": {
"description": "The name of the function's result type",
"allOf": [
{
"$ref": "#/definitions/Type"
}
]
}
}
},
"ProcedureInfo": {
"title": "Procedure Info",
"type": "object",
"required": [
"arguments",
"name",
"result_type"
],
"properties": {
"name": {
"description": "The name of the procedure",
"type": "string"
},
"description": {
"description": "Column description",
"type": [
"string",
"null"
]
},
"arguments": {
"description": "Any arguments that this collection requires",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/ArgumentInfo"
}
},
"result_type": {
"description": "The name of the result type",
"allOf": [
{
"$ref": "#/definitions/Type"
}
]
}
}
},
"CapabilitySchemaInfo": {
"title": "Capability Schema Info",
"type": "object",
"properties": {
"query": {
"description": "Schema information relevant to query capabilities",
"anyOf": [
{
"$ref": "#/definitions/QueryCapabilitiesSchemaInfo"
},
{
"type": "null"
}
]
}
}
},
"QueryCapabilitiesSchemaInfo": {
"title": "Query Capabilities Schema Info",
"type": "object",
"properties": {
"aggregates": {
"description": "Schema information relevant to aggregate query capabilities",
"anyOf": [
{
"$ref": "#/definitions/AggregateCapabilitiesSchemaInfo"
},
{
"type": "null"
}
]
}
}
},
"AggregateCapabilitiesSchemaInfo": {
"title": "Aggregate Capabilities Schema Info",
"type": "object",
"required": [
"count_scalar_type"
],
"properties": {
"count_scalar_type": {
"description": "The scalar type which should be used for the return type of count (star_count and column_count) operations.",
"type": "string"
}
}
},
"QueryRequest": {
"title": "Query Request",
"description": "This is the request body of the query POST endpoint",
"type": "object",
"required": [
"arguments",
"collection",
"collection_relationships",
"query"
],
"properties": {
"collection": {
"description": "The name of a collection",
"type": "string"
},
"query": {
"description": "The query syntax tree",
"allOf": [
{
"$ref": "#/definitions/Query"
}
]
},
"arguments": {
"description": "Values to be provided to any collection arguments",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/Argument"
}
},
"collection_relationships": {
"description": "Any relationships between collections involved in the query request. Only used if the 'relationships' capability is supported.",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/Relationship"
}
},
"variables": {
"description": "One set of named variables for each rowset to fetch. Each variable set should be subtituted in turn, and a fresh set of rows returned. Only used if the 'query.variables' capability is supported.",
"type": [
"array",
"null"
],
"items": {
"type": "object",
"additionalProperties": true
}
}
}
},
"Query": {
"title": "Query",
"type": "object",
"properties": {
"aggregates": {
"description": "Aggregate fields of the query. Only used if the 'query.aggregates' capability is supported.",
"type": [
"object",
"null"
],
"additionalProperties": {
"$ref": "#/definitions/Aggregate"
}
},
"fields": {
"description": "Fields of the query",
"type": [
"object",
"null"
],
"additionalProperties": {
"$ref": "#/definitions/Field"
}
},
"limit": {
"description": "Optionally limit to N results",
"type": [
"integer",
"null"
],
"format": "uint32",
"minimum": 0.0
},
"offset": {
"description": "Optionally offset from the Nth result",
"type": [
"integer",
"null"
],
"format": "uint32",
"minimum": 0.0
},
"order_by": {
"description": "Optionally specify how rows should be ordered",
"anyOf": [
{
"$ref": "#/definitions/OrderBy"
},
{
"type": "null"
}
]
},
"predicate": {
"description": "Optionally specify a predicate to apply to the rows",
"anyOf": [
{
"$ref": "#/definitions/Expression"
},
{