graphql-engine/server/src-lib/Hasura
Antoine Leblanc 49d0594759 [server] prune join fields of remote relationships to remote schema (close hasura/graphql-engine#8345)
## Description

This PR fixes hasura/graphql-engine#8345: when creating the final representation of a remote relationship to a remote schema (a `RemoteJoin`), we would mistakenly label ALL join fields in the selection set as being relevant to that one relationship: if there are more than one remote relationship to process in that selection set, that would be the union of all their join fields. The problem with this error is that, when processing remote relationships, we correctly ignore all the ones for which at least one join key is null. Consequently, this error would result in us ignoring remote relationships for which an _unrelated_ join key was null, resulting in that data missing in the final JSON result.

This PR simply ensures that the aggregation of fields that are passed to `createRemoteJoin` is pruned to only contain the fields relevant to the join being created. This is a very small change, and the bulk of this PR is the regression tests.

## Changelog

__Component__ : server
__Type__: bugfix
__Product__: community-edition

### Short Changelog

fix remote relationship to remote schema sometimes being erroneously null when multiple relationships are defined on the same table / graphql object ([#8345](https://github.com/hasura/graphql-engine/issues/8345))

### Long Changelog

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6420
GitOrigin-RevId: eb54462724b007f80b674dcf234adf6d9cfaaf79
2022-10-20 00:11:51 +00:00
..
Backends Add support for explain in CockroachDB 2022-10-18 16:49:03 +00:00
Base Structured Error Protocol for Data Connectors Agents - GDW-137 2022-10-11 00:26:24 +00:00
Cache server, pro: actually reformat the code-base using ormolu 2021-09-23 22:57:37 +00:00
Eventing Webhook Transforms: Move RequestCtx into a type family 2022-10-16 03:55:06 +00:00
GraphQL [server] prune join fields of remote relationships to remote schema (close hasura/graphql-engine#8345) 2022-10-20 00:11:51 +00:00
Incremental server: switch to ghc 9.2 (2nd try) 2022-10-06 09:09:01 +00:00
Metadata server: codecs for object & array relationships, and computed fields 2022-10-13 17:57:23 +00:00
RQL Fix conflicting data connector comparison exp GraphQL types 2022-10-18 04:19:12 +00:00
Server multitenant: make ourIdleGC parameters tunable, and with better defaults (SRE-191) 2022-10-19 21:36:56 +00:00
SQL Fix conflicting data connector comparison exp GraphQL types 2022-10-18 04:19:12 +00:00
Tracing server: support 128-bit trace ids 2022-09-20 02:50:06 +00:00
App.hs server/multitenant: resize sources' connection pools when a cloud project is scaled, global connection pooling 2022-10-17 08:06:12 +00:00
EncJSON.hs Import pg-client-hs as PG 2022-09-20 19:55:51 +00:00
GC.hs multitenant: make ourIdleGC parameters tunable, and with better defaults (SRE-191) 2022-10-19 21:36:56 +00:00
HTTP.hs Add Data Connector agent request logging, improve error messages, and add tracing support [GDW-83] 2022-07-11 08:05:40 +00:00
Incremental.hs Data connector cache invalidations 2022-09-14 13:00:47 +00:00
Logging.hs server: use metadata DB ID as ProjectID for EE lite projects 2022-09-15 09:13:56 +00:00
Name.hs Add schema implementation for Aggregation Predicates 2022-08-22 15:59:21 +00:00
QueryTags.hs server: support query tags for MSSQL data sources 2022-04-28 19:34:45 +00:00
Session.hs Import pg-client-hs as PG 2022-09-20 19:55:51 +00:00
Tracing.hs server: support 128-bit trace ids 2022-09-20 02:50:06 +00:00