graphql-engine/server/src-lib/Hasura/RQL/DDL
David Overton 346804fc67 Support nested object fields in DC API and use this to implement nest…
## Description

This change adds support for nested object fields in HGE IR and Schema Cache, the Data Connectors backend and API, and the MongoDB agent.

### Data Connector API changes

- The `/schema` endpoint response now includes an optional set of GraphQL type definitions. Table column types can refer to these definitions by name.
- Queries can now include a new field type `object` which contains a column name and a nested query. This allows querying into a nested object within a field.

### MongoDB agent changes

- Add support for querying into nested documents using the new `object` field type.

### HGE changes

- The `Backend` type class has a new type family `XNestedObjects b` which controls whether or not a backend supports querying into nested objects. This is currently enabled only for the `DataConnector` backend.
- For backends that support nested objects, the `FieldInfo` type gets a new constructor `FINestedObject`, and the `AnnFieldG` type gets a new constructor `AFNestedObject`.
- If the DC `/schema` endpoint returns any custom GraphQL type definitions they are stored in the `TableInfo` for each table in the source.
- During schema cache building, the function `addNonColumnFields` will check whether any column types match custom GraphQL object types stored in the `TableInfo`. If so, they are converted into `FINestedObject` instead of `FIColumn` in the `FieldInfoMap`.
- When building the `FieldParser`s from `FieldInfo` (function `fieldSelection`) any `FINestedObject` fields are converted into nested object parsers returning `AFNestedObject`.
- The `DataConnector` query planner converts `AFNestedObject` fields into `object` field types in the query sent to the agent.

## Limitations

### HGE not yet implemented:
- Support for nested arrays
- Support for nested objects/arrays in mutations
- Support for nested objects/arrays in order-by
- Support for filters (`where`) in nested objects/arrays
- Support for adding custom GraphQL types via track table metadata API
- Support for interface and union types
- Tests for nested objects

### Mongo agent not yet implemented:

- Generate nested object types from validation schema
- Support for aggregates
- Support for order-by
- Configure agent port
- Build agent in CI
- Agent tests for nested objects and MongoDB agent

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7844
GitOrigin-RevId: aec9ec1e4216293286a68f9b1af6f3f5317db423
2023-04-11 01:30:37 +00:00
..
Metadata server: warning in replace_metadata API 2023-02-20 14:20:38 +00:00
Permission Support nested object fields in DC API and use this to implement nest… 2023-04-11 01:30:37 +00:00
Relationship Fixing omit_tracked argument to suggest_relationships API to be more granular 2023-02-10 01:53:30 +00:00
Schema Support nested object fields in DC API and use this to implement nest… 2023-04-11 01:30:37 +00:00
Webhook Simplify Transformable Requests Module 2023-03-22 00:01:07 +00:00
Action.hs server: refactor Hasura.Metadata.Class 2023-04-03 13:36:50 +00:00
ApiLimit.hs server: add code field to warning object in metadata API responses 2023-04-06 02:41:24 +00:00
ComputedField.hs Upgrade Ormolu to v0.5. 2022-11-02 20:55:13 +00:00
ConnectionTemplate.hs server: add connection_template as an argument in pg_test_connection_template API 2023-04-03 14:27:12 +00:00
CustomTypes.hs Support nested object fields in DC API and use this to implement nest… 2023-04-11 01:30:37 +00:00
DataConnector.hs [feature branch] EE Lite Trials 2023-04-05 08:59:09 +00:00
Endpoint.hs Remove MetadataStorageT, clean up error handling. 2023-02-03 01:05:09 +00:00
EventTrigger.hs small cleanups of pro's init 2023-04-06 15:37:15 +00:00
FeatureFlag.hs Remove ServerConfigCtx. 2023-04-04 16:01:42 +00:00
GraphqlSchemaIntrospection.hs Remove HasServerConfigCtx from the schema cache build. 2023-03-27 17:44:27 +00:00
Headers.hs server: event trigger codecs 2022-12-15 20:38:21 +00:00
InheritedRoles.hs Collect Metadata dependencies in a Sequence rather than a list 2022-11-30 18:13:31 +00:00
Metadata.hs small cleanups of pro's init 2023-04-06 15:37:15 +00:00
Network.hs console: support suffix for tls allow list 2023-02-15 10:26:41 +00:00
OpenTelemetry.hs server: update metadata api for the OpenTelemetry exporter 2022-11-23 07:54:53 +00:00
Permission.hs chore(server): variable renaming around custom return type permissions 2023-04-10 14:17:20 +00:00
QueryCollection.hs Clean up Hasura.Prelude a bit 2022-10-03 21:50:53 +00:00
QueryTags.hs chore(server): move some query tags code to a sensible place 2023-03-30 21:19:38 +00:00
Relationship.hs Collect Metadata dependencies in a Sequence rather than a list 2022-11-30 18:13:31 +00:00
RemoteRelationship.hs Block adding remote relationships where they are not supported by the Data Connector agent 2023-03-08 06:01:04 +00:00
ScheduledTrigger.hs server: refactor Hasura.Metadata.Class 2023-04-03 13:36:50 +00:00
Schema.hs chore(server): move user-defined-functions into Hasura.Function.* 2023-04-03 10:20:20 +00:00
SourceKinds.hs server: codecs for backend configs 2023-03-30 15:53:55 +00:00
Warnings.hs server: add code field to warning object in metadata API responses 2023-04-06 02:41:24 +00:00