1
0
mirror of https://github.com/hasura/graphql-engine.git synced 2024-12-17 12:31:52 +03:00
graphql-engine/server/src-lib/Hasura/GraphQL/Schema
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
..
Action.hs Move RoleName into SchemaContext. 2022-07-29 15:38:44 +00:00
Backend.hs Only require MkRootFieldName in top-level functions (that make root fields) 2022-08-03 19:09:50 +00:00
BoolExp.hs Move RoleName into SchemaContext. 2022-07-29 15:38:44 +00:00
Build.hs Only require MkRootFieldName in top-level functions (that make root fields) 2022-08-03 19:09:50 +00:00
Common.hs Only require MkRootFieldName in top-level functions (that make root fields) 2022-08-03 19:09:50 +00:00
Instances.hs Rename Data Wrapper to Data Connector [GDW-89] 2022-05-02 05:04:07 +00:00
Introspect.hs server: Remove QErr and Code dependencies from the schema parsers. 2022-07-27 12:26:44 +00:00
Mutation.hs Move RoleName into SchemaContext. 2022-07-29 15:38:44 +00:00
NamingCase.hs server: transform enum with upper for graphql-default 2022-07-19 06:56:45 +00:00
Node.hs remove homebrew NESeq, use vendored 2022-07-19 08:42:28 +00:00
Options.hs Remove remote schema permissions from schema options. 2022-07-18 13:09:40 +00:00
OrderBy.hs Move RoleName into SchemaContext. 2022-07-29 15:38:44 +00:00
Parser.hs server: Remove QErr and Code dependencies from the schema parsers. 2022-07-27 12:26:44 +00:00
Postgres.hs server: Metadata origin for definitions (type parameter version v2) 2022-06-28 15:53:44 +00:00
Relay.hs Move RoleName into SchemaContext. 2022-07-29 15:38:44 +00:00
Remote.hs server: support for Apollo federation 2022-07-25 15:54:41 +00:00
RemoteRelationship.hs Move RoleName into SchemaContext. 2022-07-29 15:38:44 +00:00
Select.hs Move RoleName into SchemaContext. 2022-07-29 15:38:44 +00:00
SubscriptionStream.hs Move RoleName into SchemaContext. 2022-07-29 15:38:44 +00:00
Table.hs Move RoleName into SchemaContext. 2022-07-29 15:38:44 +00:00
Typename.hs Move MkTypename and NamingCase into their own modules. 2022-07-12 14:01:28 +00:00
Update.hs Move RoleName into SchemaContext. 2022-07-29 15:38:44 +00:00