Skip to content

Commit

Permalink
Updated to support NDC Spec v0.1.6 (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-chambers authored Aug 26, 2024
1 parent 40448c6 commit 486a07e
Show file tree
Hide file tree
Showing 8 changed files with 91 additions and 9 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# NDC TypeScript SDK Changelog

## [6.1.0] - 2024-08-26
- Updated to support [v0.1.6 of the NDC Spec](https://hasura.github.io/ndc-spec/specification/changelog.html#016) ([#37](https://github.com/hasura/ndc-sdk-typescript/pull/37))
- Support for [querying nested collections](https://hasura.github.io/ndc-spec/specification/queries/filtering.html#nested-collections) inside an EXISTS expression in a predicate

## [6.0.0] - 2024-08-08
Breaking changes ([#36](https://github.com/hasura/ndc-sdk-typescript/pull/36)):
- `Connector.healthCheck` has been removed and replaced with `Connector.getHealthReadiness`, which only returns whether the connector is able to accept requests, not whether any underlying connections to data sources actually work.
Expand Down
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hasura/ndc-sdk-typescript",
"version": "6.0.0",
"version": "6.1.0",
"description": "",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
Expand Down
59 changes: 58 additions & 1 deletion src/schema/schema.generated.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,15 @@
"$ref": "#/definitions/NestedFieldCapabilities"
}
]
},
"exists": {
"description": "Does the connector support EXISTS predicates",
"default": {},
"allOf": [
{
"$ref": "#/definitions/ExistsCapabilities"
}
]
}
}
},
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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"
}
}
Expand Down Expand Up @@ -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"
}
}
}
}
]
},
Expand Down
23 changes: 22 additions & 1 deletion src/schema/schema.generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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";
/**
Expand Down Expand Up @@ -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.
Expand All @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/schema/version.generated.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const VERSION = "0.1.5";
export const VERSION = "0.1.6";
2 changes: 1 addition & 1 deletion typegen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 486a07e

Please sign in to comment.