mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-15 09:22:43 +03:00
c1b9592f6b
### What When generating GraphQL schema for relationship fields in model filter, engine ignores `relation_comparisons` capability of the data connector. Engine would generate schema for data connectors which don't have this capability. This PR fixes that. ### How While generating fields for the filter input type, take the relationship capabilities into account. The `ObjectBooleanExpressionType` and `BooleanExpressionType` objects are quite different, hence their schema generation part is also different, and is split in two different functions (`build_comparable_relationships_schema`, and `build_new_comparable_relationships_schema`). Added checking of relationship comparison capability in both the functions. V3_GIT_ORIGIN_REV_ID: dce2b88f7792e01e5bb390ecdb580e223ec80f01
3.1 KiB
3.1 KiB
Changelog
Unreleased
Added
- Query Usage Analytics - usage analytics JSON data is attached to
execute
span usinginternal.query_usage_analytics
attribute
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.
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
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
- Add flag to (
--expose-internal-errors
) toggle whether to expose internal errors. (#759)
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.
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
Changed
Fixed
- Engine now respects
relation_comparisons
capability, when generating GraphQL schema for relationship fields in model filter. - The OpenDD schema for
DataConnectorLink
now references the correct version (v0.1.4) of the NDC schema when using the NDCCapabilitiesResponse
andSchemaResponse
types
v2024.06.13
Initial release.