Releases: hasura/ndc-spec
v0.2.1
What's Changed
- Add nested relationship filtering/ordering capabilities by @daniel-chambers in #205
- Display the pretty difference when a test fails by @codingkarthik in #203
- Add missing Millisecond enum in ExtractionFunctionDefinition type by @hgiasac in #207
- Query Relational types and capabilities by @daniel-chambers in #206
- [PQL-296] Add missing sub-capabilities for relational pushdown by @paf31 in #208
- Add
get_field
andarray_element
to relational expression by @danieljharvey in #209 - Changelog and updates for 0.2.1 by @paf31 in #210
New Contributors
- @codingkarthik made their first contribution in #203
Full Changelog: v0.2.0...v0.2.1
v0.2.0
Breaking Changes
ComparisonTarget::RootCollectionColumn
was removed and replaced by named scopes (RFC)path
was removed fromComparisonTarget::Column
(RFC)AggregateFunctionDefinition
was changed to anenum
, to support standardized aggregate functions (RFC)ComparisonValue::Column
no longer usesComparisonTarget
to pick the column. Instead, the necessary column and pathing details are inlined onto the enum variant.- Declarations of foreign keys has moved from
CollectionInfo
toObjectType
. This enables object types nested within a collection's object type to declare foreign keys. - The target column in column mappings can now reference an object-nested field. The target column is now a field path (
Vec<FieldName>
) instead of just a field (FieldName
). Column mappings occur in:Relationship::column_mapping
ForeignKeyConstraint::column_mapping
- Scalar type representations are now required, and the previously deprecated
number
andinteger
representations have been removed. - If the capability
query.aggregates
is enabled, it is now expected that the new schema propertycapabilities.query.aggregates
is also returned.
Specification
Grouping
A new section was added to the specification which allows callers to group rows and aggregate within groups, generalizing SQL's GROUP BY
functionality.
Extraction Functions
Extraction functions were added to the schema response to facilitate grouping by components of complex dimensions.
Named scopes
Root column references were generalized to named scopes. Scopes are introduced by EXISTS
expressions, and named scopes allow references to columns outside of the current scope; that is, outside the EXISTS
expression. Unlike root column references, named scopes allow the caller to refer to columns in any collection in scope, and not just the root collection.
Nested collections
NestedField::Collection
was added to support querying nested collections.- Exists predicates can now search nested collections.
Filtering involving nested scalar arrays
Nested scalar arrays can now be compared against in filter expressions.
- Exists predicates can now search nested scalar collections
- Expressions now have nested array comparison operators that can be used to test if a scalar array is empty or if it contains an element
Filter by aggregates
ComparisonTarget
was extended to allow filtering by aggregates.
Nested relationships
Nested relationships are relationships where the columns being joined upon exist on nested objects within collection's object type. While NDC 0.1.x supports selecting fields across a relationship that starts from within a nested object, it does not support nested relationships in other contexts, such as filtering and ordering. To resolve this, the following additions have been made:
ExistsInCollection::Related
has gained afield_path
field that enables descent through nested fields before applying the relationship. This enables support for filtering across a nested relationship.PathElement
has also gained afield_path
field that enables descent through nested fields before applying the relationship.PathElement
is used in multiple places, which unlocks nested relationships in these places:ComparisonValue::Column
- part of filter predicates; where the right hand side of a comparison operation references a columnComparisonTarget::Aggregate
- part of filter predicates; where the left hand side of a comparison operation references an aggregateOrderByTarget::Column
- when you want to order by a column across an object relationshipOrderByTarget::Aggregate
- when you want to order by an aggregate that happens across a nested object relationshipDimension::Column
- when selecting a column to group by that occurs across a nested object relationship
Column mappings used in relationships were also modified to allow the target column to be referenced via a field path, to allow targeting of object-nested columns across a relationship. Foreign keys are also now defined on the object type rather than the collection, which allows the declaration of foreign keys on object types that are used in nested fields inside a collection.
Nested relationships are now gated behind the relationships.nested
capabilities, and so connectors that do not declare these capabilities can expect to not have to deal with nested relationships.
Wider field arguments support
Object type fields can declare arguments that must be submitted when the field is evaluated. However, support for using these fields is not universal; there are some features which do not allow the use of fields with arguments, for example in nested field paths, or in relationship column mappings.
Now, support for field arguments has been added to:
ComparisonTarget::Column
ComparisonValue::Column
OrderByTarget::Column
Aggregate::ColumnCount
Aggregate::SingleColumn
However, field arguments are still considered an unstable feature and their use is not recommended outside of very specialized, advanced use cases.
More standard comparison operators, standard aggregate functions
Standard comparison operators have been added for >
, >=
, <
, and <=
, and string comparisons contains
, icontains
, starts_with
, istarts_with
, ends_with
and ends_with
. Connectors that have already defined these operators as custom operators should migrate them to standard operators.
In addition, aggregate functions now have a set of standard functions that can be implemented: sum
, average
, min
, max
. Connectors that have already defined these functions as custom aggregate functions should migrate them to standard aggregate functions.
X-Hasura-NDC-Version
header
Clients can now indicate the intended protocol version in a HTTP header alongside any request.
Scalar type representations
Scalar type representations are now required; previously they were optional, where a missing representation was assumed to mean JSON. In addition, the deprecated number and integer representations have been removed; a more precise representation (such as float64 or int32) should be chosen instead.
Capability-specific schema information
Certain capabilities may require specific data to be returned in the schema to support them. This data is now returned in the capabilities property on the schema response.
Specifically, there is a new schema property, capabilities.query.aggregates.count_scalar_type
, that defines the result type of all count aggregate functions. This must be returned if the capability query.aggregates
is enabled.
v0.1.6
v0.1.5
What's Changed
Rust Libraries
- Add newtypes for string types
- Expose the specification version in
ndc-models
v0.1.4
What's Changed
Specification
- Aggregates over nested fields (#144)
ndc-test
- replay test folders in alphabetical order (#149)
Fixes
- Add
impl Default
forNestedFieldCapabilities
(#143)
Full Changelog: v0.1.3...v0.1.4
v0.1.3
Specification
- Support field-level arguments. @sordina (#139)
- Support filtering and ordering by values of nested fields. @dmoverton (#138)
- Added a
biginteger
type representation @daniel-chambers (#136)
ndc-test
Rust Libraries
- Upgrade Rust to v1.78.0, and the Rust dependencies to their latest versions @SamirTalwar (#140)
- Add back features for native-tls vs rustls @paf31 (#135)
New Contributors
Full Changelog: v0.1.2...v0.1.3
v0.1.2
What's Changed
- Fix incorrect OpenAPI name for
TypeRepresentation
by @daniel-chambers in #124 - Split out an "ndc-models" crate which provides the models. by @SamirTalwar in #125
- Enable Clippy's "pedantic" warnings, and fix a bunch of lint warnings. by @SamirTalwar in #127
- RFC: remove ndc-client by @paf31 in #130
- Improve error output in
ndc-test
by @daniel-chambers in #131 - RFC: more type representations by @paf31 in #129
- Upgrade to Rust v1.77, and fix the ndc-reference Docker image. by @SamirTalwar in #128
- add ndc-models to root Cargo.toml by @hgiasac in #133
- Add Geometry type by @paf31 in #134
Full Changelog: v0.1.1...v0.1.2