graphql-engine/server/src-lib/Hasura/GraphQL
Antoine Leblanc d66d2d81fd server: use placeholder to prevent empty query roots
### Description

The GraphQL spec has to conflicting requirements:
1. an object must contain at least one field: the schema may not contain empty objects
2. the _query_root_ must always be present

Given _1_, the schema generation code removes from the schema all fields that would result in empty objects, such as a table for which a user does not have select permissions. But, as a result, our code also potentially removes _query_root_ if it is empty, breaking _2_.

This PR introduces a dummy "placeholder" field in the query root if it's empty, to ensure we never remove it from the schema.

### Remaining work

- [x] changelog entry
- [x] tests

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/148
GitOrigin-RevId: bfd6bfcc2f3de92900b6ba566012f093399ca037
2022-01-27 18:08:11 +00:00
..
Execute Prevent uses of unsafeMkName whenever possible. 2022-01-27 15:13:37 +00:00
Parser Avoid NonNullableType 2021-12-20 17:03:28 +00:00
Schema Prevent uses of unsafeMkName whenever possible. 2022-01-27 15:13:37 +00:00
Transport Experimental backend adapter 2021-12-22 00:11:28 +00:00
Analyse.hs Fixed GQL aliases not being respected in the OpenAPI schema 2022-01-27 05:55:55 +00:00
Context.hs Source typename customization (close graphql-engine#6974) 2021-10-29 14:43:14 +00:00
Execute.hs multitenant: support for starting multitenant in read only mode 2021-12-08 06:27:49 +00:00
Explain.hs Source typename customization (close graphql-engine#6974) 2021-10-29 14:43:14 +00:00
Logging.hs Source typename customization (close graphql-engine#6974) 2021-10-29 14:43:14 +00:00
Namespace.hs Refactor type name customization 2021-11-30 09:52:53 +00:00
ParameterizedQueryHash.hs Prevent uses of unsafeMkName whenever possible. 2022-01-27 15:13:37 +00:00
Parser.hs server, pro: actually reformat the code-base using ormolu 2021-09-23 22:57:37 +00:00
RemoteServer.hs Add request body to OpenAPI 2021-12-22 08:31:14 +00:00
Schema.hs server: use placeholder to prevent empty query roots 2022-01-27 18:08:11 +00:00