graphql-engine/server
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
..
benchmarks Revert "server/benchmarks: update the postgres version to 15" 2023-03-13 15:27:38 +00:00
documentation Fix haskell error in example code block 2023-04-04 11:28:35 +00:00
lib Support nested object fields in DC API and use this to implement nest… 2023-04-11 01:30:37 +00:00
src-emit-metadata-openapi harmonize network manager handling 2023-02-22 15:55:54 +00:00
src-exec [feature branch] EE Lite Trials 2023-04-05 08:59:09 +00:00
src-lib Support nested object fields in DC API and use this to implement nest… 2023-04-11 01:30:37 +00:00
src-rsr ci: tag release v2.22.1 2023-04-07 11:15:45 +00:00
src-test Support nested object fields in DC API and use this to implement nest… 2023-04-11 01:30:37 +00:00
test-manual server/test-manual: A way to start PostgreSQL with a read replica. 2023-03-28 09:20:51 +00:00
test-mssql server: Split the integration tests out into their own directories. 2022-11-17 12:56:26 +00:00
test-postgres small cleanups of pro's init 2023-04-06 15:37:15 +00:00
tests-py chore(tests): explicitly set BigQuery retry limit in py-tests 2023-03-28 10:42:00 +00:00
.dockerignore update packages (#251) 2018-08-08 13:10:13 +05:30
.gitignore server: Clean up Cabal project files 2022-04-07 07:16:12 +00:00
.ormolu Upgrade Ormolu to v0.5. 2022-11-02 20:55:13 +00:00
commit_diff.txt Rewrite GraphQL schema generation and query parsing (close #2801) (#4111) 2020-08-21 12:27:01 -05:00
COMPILING-ON-MACOS.md frontend: switch cli and server to use the new nx assets 2023-01-25 12:07:01 +00:00
CONTRIBUTING.md nix: Switch to nixpkgs-unstable. 2023-03-24 20:36:48 +00:00
graphql-engine.cabal feature(server): Get _all_ source tables 2023-04-05 20:16:14 +00:00
Makefile ci: misc. cleanup, naming 2022-01-03 06:26:39 +00:00
STYLE.md Nix: Use nixpkgs-fmt to format everything. 2022-06-20 13:02:45 +00:00
testing-guidelines.md Extract the test harness from the Hspec tests 2022-10-04 08:31:26 +00:00
troubleshooting.md Create troubleshooting.md 2022-05-30 09:18:44 +00:00
VERSIONS.json nix: Switch to nixpkgs-unstable. 2023-03-24 20:36:48 +00:00