graphql-engine/server/src-test/Test/Parser
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
..
Expectation.hs server: transform enum with upper for graphql-default 2022-07-19 06:56:45 +00:00
Field.hs server: Metadata origin for definitions (type parameter version v2) 2022-06-28 15:53:44 +00:00
Internal.hs Only require MkRootFieldName in top-level functions (that make root fields) 2022-08-03 19:09:50 +00:00
Monad.hs Move RoleName into SchemaContext. 2022-07-29 15:38:44 +00:00