graphql-engine/server/src-lib/Hasura/GraphQL
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
..
Execute [server] prune join fields of remote relationships to remote schema (close hasura/graphql-engine#8345) 2022-10-20 00:11:51 +00:00
Schema Improve description for table select columns enum type 2022-10-03 11:00:10 +00:00
Transport server: add api limit - batch limit 2022-10-13 16:54:26 +00:00
Analyse.hs Rewrite OpenAPI 2022-06-30 12:57:09 +00:00
ApolloFederation.hs server: switch to ghc 9.2 (2nd try) 2022-10-06 09:09:01 +00:00
Context.hs server: runParse returns QErr 2022-06-16 12:22:30 +00:00
Execute.hs server: Remove QErr and Code dependencies from the schema parsers. 2022-07-27 12:26:44 +00:00
Explain.hs server: support for Apollo federation 2022-07-25 15:54:41 +00:00
Logging.hs Source typename customization (close graphql-engine#6974) 2021-10-29 14:43:14 +00:00
Namespace.hs Move MkTypename and NamingCase into their own modules. 2022-07-12 14:01:28 +00:00
ParameterizedQueryHash.hs Implement HLint suggestions and turn warnings into errors 2022-07-01 10:50:33 +00:00
RemoteServer.hs Use a different reader context for sources and remote schemas with new SchemaT monad. 2022-09-06 16:49:23 +00:00
Schema.hs server: Permit strings for numerical input fields 2022-09-30 13:25:57 +00:00