graphql-engine/server/tests-py/queries
Antoine Leblanc eaba2e08d3 Clean Relay's code, break schema cycles, introduce Node ID V2
## Motivation

This PR rewrites most of Relay to achieve the following:
- ~~fix a bug in which the same node id could refer to two different tables in the schema~~
- remove one of the few remaining uses of the source cache in the schema building code

In doing so, it also:
- simplifies the `BackendSchema` class by removing `node` from it,
- makes it much easier for other backends to support Relay,
- documents, re-organizes, and clarifies the code.

## Description

This PR introduces a new `NodeId` version ~~, and adapts the Postgres code to always generate this V2 version~~. This new id contains the source name, in addition to the table name, in order to disambiguate similar table names across different sources (which is now possible with source customization). In doing so, it now explicitly handles that case for V1 node ids, and returns an explicit error message instead of running the risk of _silently returning the wrong information_.

Furthermore, it adapts `nodeField` to support multiple backends; most of the code was trivial to generalize, and as a result it lowers the cost of entry for other backends, that now only need to support `AFNodeId` in their translation layer.

Finally, it removes one more cycle in the schema building code, by using the same trick we used for remote relationships instead of using the memoization trick of #4576.

## Remaining work

- ~~[ ]write a Changelog entry~~
- ~~[x] adapt all tests that were asserting on an old node id~~

## Future work

This PR was adapted from its original form to avoid a breaking change: while it introduces a Node ID V2, we keep generating V1 IDs and the parser rejects V2 IDs. It will be easy to make the switch at a later data in a subsequent PR.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4593
GitOrigin-RevId: 88e5cb91e8b0646900547fa8c7c0e1463de267a1
2022-06-07 13:36:29 +00:00
..
actions server: add support for custom scalar in action output types 2022-06-03 09:48:26 +00:00
compression [server] coalesce multiple run_sql calls in tests (#270) 2021-01-06 16:07:22 +00:00
endpoints Fixing URL parameter for variable <name> not supported bug in REST endpoints for Dates 2022-05-02 03:34:34 +00:00
event_triggers server: Use quote_ident for quoting table name when using regclass 2022-05-02 13:16:55 +00:00
explain server/bigquery: computed fields SQL generation and execution 2022-05-30 15:24:33 +00:00
graphql_introspection Customize column GraphQL schema descriptions 2022-03-09 06:35:46 +00:00
graphql_mutation Refactor insert mutations IR use of "default values" 2022-04-21 16:34:04 +00:00
graphql_query Clean Relay's code, break schema cycles, introduce Node ID V2 2022-06-07 13:36:29 +00:00
graphql_validation server: unify parsing Postgres scalars 2021-05-13 20:13:49 +00:00
heterogeneous [server] coalesce multiple run_sql calls in tests (#270) 2021-01-06 16:07:22 +00:00
horizontal_scale/basic sync metadata cache across multiple instances connected to same db (closes #1182) (#1574) 2019-03-12 11:16:27 +05:30
inconsistent_objects Remove all functions from RQL.Types.hs 2022-04-26 15:13:57 +00:00
logging [server] coalesce multiple run_sql calls in tests (#270) 2021-01-06 16:07:22 +00:00
naming_conventions server: hotfix for default naming convention issue 2022-05-31 09:09:04 +00:00
openapi Rewrite GraphQL.Analysis 2022-04-04 05:54:59 +00:00
query_cache server: disable caching for actions with forward client headers enabled 2021-04-13 07:01:34 +00:00
remote_schemas server: do not serialize env vars in logs or errors: PR I - Remote Schemas 2022-05-21 09:05:59 +00:00
scheduled_triggers server: fix flaky test_check_events_statuses test 2021-10-22 05:55:59 +00:00
schema/duplication Fix/custom table name 2021-05-18 13:37:27 +00:00
subscriptions server: streaming subscriptions schema generation and tests (incremental PR - 3) 2022-04-22 19:54:11 +00:00
unauthorized_role Adding multiple jwt secrets (incorporating provenance requirements) 2022-02-13 23:34:39 +00:00
v1 server: add custom table name in EnumReference 2022-04-13 10:08:21 +00:00
v2 server/mssql: improve database exception handling and better API errors 2022-02-07 14:12:55 +00:00
webhooks/request_context pass gql requests into auth webhook POST body (#149) 2021-02-03 07:11:39 +00:00
clear_db_bigquery.yaml Feature/bigquery python tests 2021-04-22 11:32:55 +00:00
clear_db_citus.yaml server/citus: feature branch 2021-05-21 02:47:51 +00:00
clear_db_mssql.yaml server: generalize integration tests 2021-03-11 18:18:41 +00:00
clear_db.yaml python based tests (#387) 2018-09-18 11:51:57 +05:30