diff --git a/Cargo.lock b/Cargo.lock index ddb7426..544395b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -238,8 +238,8 @@ checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" [[package]] name = "ndc-models" -version = "0.1.5" -source = "git+http://github.com/hasura/ndc-spec.git?tag=v0.1.5#78f52768bd02a8289194078a5abc2432c8e3a758" +version = "0.1.6" +source = "git+http://github.com/hasura/ndc-spec.git?tag=v0.1.6#d1be19e9cdd86ac7b6ad003ff82b7e5b4e96b84f" dependencies = [ "indexmap 2.2.6", "ref-cast", diff --git a/src/schema/schema.generated.json b/src/schema/schema.generated.json index 95ce4f4..a2e9c36 100644 --- a/src/schema/schema.generated.json +++ b/src/schema/schema.generated.json @@ -131,6 +131,15 @@ "$ref": "#/definitions/NestedFieldCapabilities" } ] + }, + "exists": { + "description": "Does the connector support EXISTS predicates", + "default": {}, + "allOf": [ + { + "$ref": "#/definitions/ExistsCapabilities" + } + ] } } }, @@ -177,6 +186,23 @@ } } }, + "ExistsCapabilities": { + "title": "Exists Capabilities", + "type": "object", + "properties": { + "nested_collections": { + "description": "Does the connector support ExistsInCollection::NestedCollection", + "anyOf": [ + { + "$ref": "#/definitions/LeafCapability" + }, + { + "type": "null" + } + ] + } + } + }, "MutationCapabilities": { "title": "Mutation Capabilities", "type": "object", @@ -684,7 +710,7 @@ ] }, "name": { - "description": "The name can refer to a primitive type or a scalar type", + "description": "The name can refer to a scalar or object type", "type": "string" } } @@ -1983,6 +2009,37 @@ } } } + }, + { + "type": "object", + "required": [ + "column_name", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "nested_collection" + ] + }, + "column_name": { + "type": "string" + }, + "arguments": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/Argument" + } + }, + "field_path": { + "description": "Path to a nested collection via object columns", + "type": "array", + "items": { + "type": "string" + } + } + } } ] }, diff --git a/src/schema/schema.generated.ts b/src/schema/schema.generated.ts index 9e70f03..965340a 100644 --- a/src/schema/schema.generated.ts +++ b/src/schema/schema.generated.ts @@ -82,7 +82,7 @@ export type Type = | { type: "named"; /** - * The name can refer to a primitive type or a scalar type + * The name can refer to a scalar or object type */ name: string; } @@ -343,6 +343,17 @@ export type ExistsInCollection = arguments: { [k: string]: RelationshipArgument; }; + } + | { + type: "nested_collection"; + column_name: string; + arguments?: { + [k: string]: Argument; + }; + /** + * Path to a nested collection via object columns + */ + field_path?: string[]; }; export type RelationshipType = "object" | "array"; /** @@ -411,6 +422,10 @@ export interface QueryCapabilities { * Does the connector support nested fields */ nested_fields?: NestedFieldCapabilities; + /** + * Does the connector support EXISTS predicates + */ + exists?: ExistsCapabilities; } /** * A unit value to indicate a particular leaf capability is supported. This is an empty struct to allow for future sub-capabilities. @@ -430,6 +445,12 @@ export interface NestedFieldCapabilities { */ aggregates?: LeafCapability | null; } +export interface ExistsCapabilities { + /** + * Does the connector support ExistsInCollection::NestedCollection + */ + nested_collections?: LeafCapability | null; +} export interface MutationCapabilities { /** * Does the connector support executing multiple mutations in a transaction. diff --git a/src/schema/version.generated.ts b/src/schema/version.generated.ts index a38e38f..f98b03c 100644 --- a/src/schema/version.generated.ts +++ b/src/schema/version.generated.ts @@ -1 +1 @@ -export const VERSION = "0.1.5"; +export const VERSION = "0.1.6"; diff --git a/typegen/Cargo.toml b/typegen/Cargo.toml index d0006e5..6ca3a01 100644 --- a/typegen/Cargo.toml +++ b/typegen/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -ndc-models = { git = "http://github.com/hasura/ndc-spec.git", tag = "v0.1.5" } +ndc-models = { git = "http://github.com/hasura/ndc-spec.git", tag = "v0.1.6" } schemars = "0.8.15" serde = "^1.0" serde_json = "1.0.107"