graphql-engine/server/src-lib/Hasura/GraphQL
Antoine Leblanc 40db3d7eab Resolve source customization at schema cache building time.
### Description

This PR attempts to fix several issues with source customization as it relates to remote relationships. There were several issues regarding casing: at the relationship border, we didn't properly set the target source's case, we didn't have access to the list of supported features to decide whether the feature was allowed or not, and we didn't have access to the global default.

However, all of that information is available when we build the schema cache, as we do resolve the case of some elements such as function names: we can therefore resolve source information at the same time, and simplify both the root of the schema and the remote relationship border.

To do this, this PR introduces a new type, `ResolvedSourceCustomization`, to be used in the Schema Cache, as opposed to the metadata's `SourceCustomization`, following a pattern established by a lot of other types.

### Remaining work and open questions

One major point of confusion: it seems to me that we didn't set the case at all across remote relationships, which would suggest we would use the case of the LHS source across the subset of the RHS one that is accessible through the remote relationship, which would in turn "corrupt" the parser cache and might result in the wrong case being used for that source later on. Is that assesment correct, and was I right to fix it?

Another one is that we seem not to be using the local case of the RHS to name the field in an object relationship; unless I'm mistaken we only use it for array relationships? Is that intentional?

This PR is also missing tests that would show-case the difference, and a changelog entry. To my knowledge, all the tests of this feature are in the python test suite; this could be the opportunity to move them to the hspec suite, but this might be a considerable amount of work?

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5619
GitOrigin-RevId: 51a81b713a74575e82d9f96b51633f158ce3a47b
2022-09-12 16:07:26 +00:00
..
Execute refactor(tests): Remove use of unsafeCoerce 2022-09-07 11:22:14 +00:00
Schema Resolve source customization at schema cache building time. 2022-09-12 16:07:26 +00:00
Transport Use NonNegative types for arg/env parsing 2022-08-17 01:09:19 +00:00
Analyse.hs Rewrite OpenAPI 2022-06-30 12:57:09 +00:00
ApolloFederation.hs server: support for Apollo federation 2022-07-25 15:54:41 +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 Resolve source customization at schema cache building time. 2022-09-12 16:07:26 +00:00