graphql-engine/server/src-lib/Hasura/Backends/Postgres/Instances
Antoine Leblanc 666f4cacb7 Only require MkRootFieldName in top-level functions (that make root fields)
### Description

By definition, root fields are at the root of the schema: only functions that craft root fields need to know about how to customize the name of root fields. However, the presence of `Has MkRootFieldName` in `MonadBuildSchemaBase` meant that the entirety of the schema building code was implicitly aware of / capable of altering root field names.

This PR removes this constraint, and moves it to the functions that do craft root fields. This has several upsides:
- it makes it more explicit where root fields are being crafted
- it prevents functions that should not use this from mistakenly applying it to non-root fields
- it simplifies the shared schema context

### Future work

- can we maybe pass this as an argument, instead of making it a required part of the context?
- ~~AFAICT, we only ever use `mempty` for it: is this actually dead code that we should actually just remove altogether?~~

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5235
GitOrigin-RevId: 4268751f3ab87ae8e03b6fe9e1efa1b096200027
2022-08-03 19:09:50 +00:00
..
API.hs server/bigquery: enable metadata API to add/drop computed fields to BigQuery tables 2022-05-04 14:53:31 +00:00
Execute.hs Remove strictness annotations from data types in the Hasura.Backends hierarchy 2022-07-29 14:06:23 +00:00
Metadata.hs server/bigquery: generate graphql schema for table computed fields 2022-05-25 10:25:38 +00:00
Schema.hs Only require MkRootFieldName in top-level functions (that make root fields) 2022-08-03 19:09:50 +00:00
Transport.hs server: Reorganize quasi-quoted names. 2022-06-23 09:15:31 +00:00
Types.hs server: postgres multiple updates 2022-07-18 15:16:47 +00:00