2024-06-25 11:59:53 +03:00
|
|
|
# Changelog
|
|
|
|
|
|
|
|
## [Unreleased]
|
|
|
|
|
2024-07-18 16:54:32 +03:00
|
|
|
### Added
|
2024-07-10 12:59:14 +03:00
|
|
|
|
2024-07-24 17:02:12 +03:00
|
|
|
### Fixed
|
|
|
|
|
|
|
|
### Changed
|
|
|
|
|
2024-07-25 15:40:15 +03:00
|
|
|
## [v2024.07.25]
|
|
|
|
|
|
|
|
### Fixed
|
|
|
|
|
|
|
|
- Ensured `traceresponse` header is returned
|
|
|
|
|
2024-07-24 17:02:12 +03:00
|
|
|
## [v2024.07.24]
|
|
|
|
|
|
|
|
### Added
|
|
|
|
|
2024-07-23 12:59:44 +03:00
|
|
|
- The metadata resolve step now emits warnings to let users know about
|
|
|
|
soon-to-be deprecated features and suggest fixes.
|
|
|
|
|
2024-07-10 12:59:14 +03:00
|
|
|
### Fixed
|
|
|
|
|
2024-07-23 16:35:24 +03:00
|
|
|
- Fixes a bug where boolean expressions passed as arguments would not be
|
|
|
|
translated into NDC `Expression` types before being sent to the data
|
|
|
|
connector.
|
|
|
|
|
2024-07-23 11:11:47 +03:00
|
|
|
- Fixes a bug where relationships within nested columns would throw an internal
|
|
|
|
error. While generating NDC relationship definitions, engine would ignore
|
|
|
|
columns with nested selection.
|
|
|
|
|
2024-07-19 12:09:39 +03:00
|
|
|
- Renamed the `ArgumentPreset` for data connectors to
|
|
|
|
`DataConnectorArgumentPreset` to avoid ambiguity in generated JSONSchema.
|
|
|
|
|
2024-07-18 16:54:32 +03:00
|
|
|
### Changed
|
2024-07-10 12:59:14 +03:00
|
|
|
|
2024-07-23 12:59:44 +03:00
|
|
|
- Fixed a bug where command targeted relationships were not using the Open DD
|
|
|
|
argument name instead of the data connector's argument name when querying the
|
|
|
|
data connector
|
|
|
|
|
2024-07-18 16:54:32 +03:00
|
|
|
## [v2024.07.18]
|
2024-07-04 13:24:58 +03:00
|
|
|
|
2024-06-25 11:59:53 +03:00
|
|
|
### Added
|
|
|
|
|
Implement remote relationship predicates in where filter clause (#761)
Now, users can filter their queries using remote relationships in the
filter predicate. Users need to provide the relationships for comparison
in `comparableRelationships` field of the newer `BooleanExpressionType`
opendd metadata.
Minimal Algorithm:
```
Relationship: ARemoteB => Model_A -> Model_B (remote NDC)
Column Mapping: (A_column_1, B_column_1), (A_column_2, B_column_2).
query:
Model_A:
where: ARemoteB: {B_column_3: {_eq: value}}
Step 1: Fetch RHS column values (in mapping) from remote target model
SELECT B_column_1, B_column_2 from model_b_collection WHERE B_column_3 = value;
yields the following rows
[
[(B_column_1, b_value_1), (B_column_2, b_value_2)],
[(B_column_1, b_value_11), (B_column_2, b_value_22)],
]
Step 2: Using above rows the generate LHS column filter for Model_A query.
SELECT <fields> from model_a_collection WHERE
((A_column_1 = b_value_1) AND (A_column_2 = b_value_2))
OR ((A_column_1 = b_value_11) AND (A_column_2 = b_value_22))
The above comparison is equivalent to
WHERE
(A_column_1, A_column_2) IN ((b_value_1, b_value_11), (b_value_2, b_value_22))
```
Sample query:
```graphql
query MyQuery {
Track(
where: {
_or: [
{ AlbumRemote: { Artist: { ArtistId: { _eq: 2 } } } }
{ TrackId: { _eq: 3 } }
]
}
) {
TrackId
AlbumRemote {
Artist {
ArtistId
Name
}
}
}
}
```
In the query above, `AlbumRemote` is a remote relationship which targets
a model backed by a different data connector.
V3_GIT_ORIGIN_REV_ID: 7aa76fcae83e1f22de460f1eef5648fb7a35c047
2024-07-18 10:46:16 +03:00
|
|
|
#### Remote Relationships in Query Filter
|
|
|
|
|
|
|
|
We have enhanced the GraphQL query capabilities to support array and object
|
|
|
|
relationships targeting models backed by different data connectors. This allows
|
|
|
|
you to specify remote relationships directly within the `where` expression of
|
|
|
|
your queries.
|
|
|
|
|
|
|
|
**Example:** Retrieve a list of customers who have been impacted by cancelled
|
|
|
|
orders during the current sale event. This data should be filtered based on
|
|
|
|
order logs stored in a separate data source.
|
|
|
|
|
|
|
|
```graphql
|
|
|
|
query CustomersWithFailedOrders {
|
|
|
|
Customers(
|
|
|
|
where: {
|
|
|
|
OrderLogs: {
|
|
|
|
_and: [
|
|
|
|
{ timestamp: { _gt: "2024-10-10" } }
|
|
|
|
{ status: { _eq: "cancelled" } }
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
) {
|
|
|
|
CustomerId
|
|
|
|
EmailId
|
|
|
|
OrderLogs {
|
|
|
|
OrderId
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
By incorporating remote relationships into the where expression, you can
|
|
|
|
seamlessly query and filter data that spans across multiple data sources, making
|
|
|
|
your GraphQL queries more versatile and powerful.
|
|
|
|
|
2024-07-18 16:54:32 +03:00
|
|
|
### Fixed
|
|
|
|
|
|
|
|
- Build-time check to ensure boolean expressions cannot be built over nested
|
|
|
|
array fields until these are supported.
|
|
|
|
|
2024-07-23 11:11:47 +03:00
|
|
|
- Fixed a bug where command targeted relationships were not using the OpenDD
|
2024-07-18 16:54:32 +03:00
|
|
|
argument name instead of the data connector's argument name when querying the
|
2024-07-23 11:11:47 +03:00
|
|
|
data connector.
|
2024-07-18 16:54:32 +03:00
|
|
|
|
|
|
|
## [v2024.07.10]
|
|
|
|
|
|
|
|
### Fixed
|
|
|
|
|
|
|
|
- Fixes a bug with variable nullability coercion. Specifically, providing a
|
|
|
|
non-null variable for a nullable field should work, as all non-nullable
|
|
|
|
variables can be used as nullable variables via "coercion".
|
|
|
|
|
|
|
|
- Fixes a bug where data connectors without the `foreach` capability were not
|
|
|
|
allowed to create local relationships
|
|
|
|
|
|
|
|
## [v2024.07.04]
|
|
|
|
|
|
|
|
### Added
|
|
|
|
|
2024-07-01 15:09:27 +03:00
|
|
|
- Query Usage Analytics - usage analytics JSON data is attached to `execute`
|
|
|
|
span using `internal.query_usage_analytics` attribute
|
2024-07-01 18:28:27 +03:00
|
|
|
|
2024-07-04 13:24:58 +03:00
|
|
|
- Added a flag, `--partial-supergraph`, which instructs the metadata resolver to
|
|
|
|
prune relationships to unknown subgraphs rather than failing to resolve
|
|
|
|
|
2024-07-01 18:28:27 +03:00
|
|
|
#### Boolean Expression Types
|
|
|
|
|
|
|
|
A new metadata kind `BooleanExpressionType` can now be defined. These can be
|
|
|
|
used in place of `ObjectBooleanExpressionType` and
|
|
|
|
`DataConnectorScalarRepresentation`, and allow more granular control of
|
|
|
|
comparison operators and how they are used.
|
|
|
|
|
|
|
|
```yaml
|
|
|
|
kind: BooleanExpressionType
|
|
|
|
version: v1
|
|
|
|
definition:
|
|
|
|
name: album_bool_exp
|
|
|
|
operand:
|
|
|
|
object:
|
|
|
|
type: Album
|
|
|
|
comparableFields:
|
|
|
|
- fieldName: AlbumId
|
|
|
|
booleanExpressionType: pg_int_comparison_exp
|
|
|
|
- fieldName: ArtistId
|
|
|
|
booleanExpressionType: pg_int_comparison_exp_with_is_null
|
|
|
|
- field: Address
|
|
|
|
booleanExpressionType: address_bool_exp
|
|
|
|
comparableRelationships:
|
|
|
|
- relationshipName: Artist
|
|
|
|
booleanExpressionType: artist_bool_exp
|
|
|
|
logicalOperators:
|
|
|
|
enable: true
|
|
|
|
isNull:
|
|
|
|
enable: true
|
|
|
|
graphql:
|
|
|
|
typeName: app_album_bool_exp
|
|
|
|
```
|
|
|
|
|
|
|
|
```yaml
|
|
|
|
kind: BooleanExpressionType
|
|
|
|
version: v1
|
|
|
|
definition:
|
|
|
|
name: pg_int_comparison_exp
|
|
|
|
operand:
|
|
|
|
scalar:
|
|
|
|
type: Int
|
|
|
|
comparisonOperators:
|
|
|
|
- name: equals
|
|
|
|
argumentType: String!
|
|
|
|
- name: _in
|
|
|
|
argumentType: [String!]!
|
|
|
|
dataConnectorOperatorMapping:
|
|
|
|
- dataConnectorName: postgres_db
|
|
|
|
dataConnectorScalarType: String
|
|
|
|
operatorMapping:
|
|
|
|
equals: _eq
|
|
|
|
logicalOperators:
|
|
|
|
enable: true
|
|
|
|
isNull:
|
|
|
|
enable: true
|
|
|
|
graphql:
|
|
|
|
typeName: app_postgres_int_bool_exp
|
|
|
|
```
|
|
|
|
|
2024-06-27 15:42:27 +03:00
|
|
|
- Add flag to (`--expose-internal-errors`) toggle whether to expose internal
|
|
|
|
errors. ([#759](https://github.com/hasura/v3-engine/pull/759))
|
|
|
|
|
2024-06-26 13:48:25 +03:00
|
|
|
#### Aggregates of Array Relationships
|
|
|
|
|
|
|
|
Aggregates of array relationships can now be defined by specifying an
|
|
|
|
`aggregate` in the `Relationship`'s target. Note that this is only supported
|
|
|
|
when the target of the relationship is a `Model`. You must also specify the
|
|
|
|
`aggregateFieldName` under the `graphql` section.
|
|
|
|
|
|
|
|
```yaml
|
|
|
|
kind: Relationship
|
|
|
|
version: v1
|
|
|
|
definition:
|
|
|
|
name: invoices
|
|
|
|
sourceType: Customer
|
|
|
|
target:
|
|
|
|
model:
|
|
|
|
name: Invoice
|
|
|
|
relationshipType: Array
|
|
|
|
aggregate: # New!
|
|
|
|
aggregateExpression: Invoice_aggregate_exp
|
|
|
|
description: Aggregate of the customer's invoices
|
|
|
|
mapping:
|
|
|
|
- source:
|
|
|
|
fieldPath:
|
|
|
|
- fieldName: customerId
|
|
|
|
target:
|
|
|
|
modelField:
|
|
|
|
- fieldName: customerId
|
|
|
|
graphql: # New!
|
|
|
|
aggregateFieldName: invoicesAggregate
|
|
|
|
```
|
|
|
|
|
2024-07-04 13:24:58 +03:00
|
|
|
- One can now configure the engine to set response headers for GraphQL requests,
|
|
|
|
if NDC function/procedures returns headers in its result
|
|
|
|
|
|
|
|
#### Field arguments
|
|
|
|
|
|
|
|
Add field arguments to the OpenDD `ObjectType`:
|
|
|
|
|
|
|
|
```yaml
|
|
|
|
kind: ObjectType
|
|
|
|
version: v1
|
|
|
|
definition:
|
|
|
|
name: institution
|
|
|
|
fields:
|
|
|
|
- name: id
|
|
|
|
type: Int!
|
|
|
|
- name: name
|
|
|
|
type: String!
|
|
|
|
arguments:
|
|
|
|
- name: hash
|
|
|
|
argumentType: String
|
|
|
|
- name: limit
|
|
|
|
argumentType: Int
|
|
|
|
- name: offset
|
|
|
|
argumentType: Int
|
|
|
|
graphql:
|
|
|
|
typeName: Institution
|
|
|
|
dataConnectorTypeMapping:
|
|
|
|
- dataConnectorName: custom
|
|
|
|
dataConnectorObjectType: institution
|
|
|
|
fieldMapping:
|
|
|
|
id:
|
|
|
|
column:
|
|
|
|
name: id
|
|
|
|
name:
|
|
|
|
column:
|
|
|
|
name: name
|
|
|
|
argumentMapping:
|
|
|
|
hash: hash
|
|
|
|
offset: offset
|
|
|
|
limit: limit
|
|
|
|
```
|
|
|
|
|
2024-06-25 11:59:53 +03:00
|
|
|
### Changed
|
|
|
|
|
|
|
|
### Fixed
|
|
|
|
|
2024-07-02 10:48:23 +03:00
|
|
|
- Engine now respects `relation_comparisons` capability, when generating GraphQL
|
2024-07-04 13:24:58 +03:00
|
|
|
schema for relationship fields in model filter
|
2024-07-02 10:48:23 +03:00
|
|
|
- The OpenDD schema for `DataConnectorLink` now references the correct version
|
2024-06-27 06:49:38 +03:00
|
|
|
(v0.1.4) of the NDC schema when using the NDC `CapabilitiesResponse` and
|
|
|
|
`SchemaResponse` types
|
|
|
|
|
2024-06-25 11:59:53 +03:00
|
|
|
## [v2024.06.13]
|
|
|
|
|
|
|
|
Initial release.
|
|
|
|
|
|
|
|
<!-- end -->
|
|
|
|
|
2024-07-18 16:54:32 +03:00
|
|
|
[Unreleased]: https://github.com/hasura/v3-engine/compare/v2024.07.18...HEAD
|
|
|
|
[v2024.07.18]: https://github.com/hasura/v3-engine/releases/tag/v2024.07.18
|
2024-07-10 12:59:14 +03:00
|
|
|
[v2024.07.10]: https://github.com/hasura/v3-engine/releases/tag/v2024.07.10
|
2024-07-18 16:54:32 +03:00
|
|
|
[v2024.07.04]: https://github.com/hasura/v3-engine/releases/tag/v2024.07.04
|
|
|
|
[v2024.06.13]: https://github.com/hasura/v3-engine/releases/tag/v2024.06.13
|