graphql-engine/server
Antoine Leblanc 498442b1d3 Remove circular dependency in schema building code
### Description

The main goal of this PR is, as stated, to remove the circular dependency in the schema building code. This cycle arises from the existence of remote relationships: when we build the schema for a source A, a remote relationship might force us to jump to the schema of a source B, or some remote schema. As a result, we end up having to do a dispatch from a "leaf" of the schema, similar to the one done at the root. In turn, this forces us to carry along in the schema a lot of information required for that dispatch, AND it forces us to import the instances in scope, creating an import loop.

As discussed in #4489, this PR implements the "dependency injection" solution: we pass to the schema a function to call to do the dispatch, and to get a generated field for a remote relationship. That way, this function can be chosen at the root level, and the leaves need not be aware of the overall context.

This PR grew a bit bigger than that, however; in an attempt to try and remove the `SourceCache` from the schema altogether, it changed a lot of functions across the schema building code, to thread along the `SourceInfo b` of the source being built. This avoids having to do cache lookups within a given source. A few cases remain, such as relay, that we might try to tackle in a subsequent PR.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4557
GitOrigin-RevId: 9388e48372877520a72a9fd1677005df9f7b2d72
2022-05-27 17:22:38 +00:00
..
bench-wrk server, pro: actually reformat the code-base using ormolu 2021-09-23 22:57:37 +00:00
benchmarks ci: hide old benchmark reports for PRs with many comments 2022-02-24 20:09:17 +00:00
documentation server/tests: unify HASURA_BIGQUERY_SERVICE_KEY and HASURA_BIGQUERY_SERVICE_ACCOUNT env vars 2022-03-14 07:50:35 +00:00
packaging ci: use pg_dump from postgres 14 2022-04-18 06:25:02 +00:00
src-dc-api GDC: Integration Tests and Servant Agent 2022-05-11 06:15:27 +00:00
src-exec Remove RQL/Types.hs 2022-04-27 13:58:47 +00:00
src-lib Remove circular dependency in schema building code 2022-05-27 17:22:38 +00:00
src-rsr ci: tag release v2.7.0 2022-05-25 10:55:59 +00:00
src-test Remove circular dependency in schema building code 2022-05-27 17:22:38 +00:00
tests-dc-api Data Connector Agent Configuration Schema [GDW-103] 2022-05-05 05:19:46 +00:00
tests-hspec Add unless/when related hints 2022-05-27 13:34:42 +00:00
tests-py server/docs: follow up on the naming convention 2022-05-27 05:56:52 +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
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 Improve COMPILING-ON-MACOS.md 2022-05-09 08:32:56 +00:00
CONTRIBUTING.md server/tests: Troubleshooting docs 2022-05-04 08:23:53 +00:00
graphql-engine.cabal server: add infrastructure to write runit tests for update parsers 2022-05-26 14:06:24 +00:00
Makefile ci: misc. cleanup, naming 2022-01-03 06:26:39 +00:00
STYLE.md server, CI: use ormolu as a formatter for Haskell sources 2021-09-23 21:23:21 +00:00
testing-guidelines.md server: testing guidelines 2022-03-08 09:53:27 +00:00