graphql-engine/server/tests-py/queries/graphql_query/basic
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
..
author_with_permission_mssql.yaml Parse session variables to their correct type in mssql 2021-11-20 09:03:44 +00:00
nested_select_query_article_author_where_on_relationship.yaml introduce v1/graphql (fix #1368) (#2064) 2019-05-10 11:35:10 +05:30
nested_select_query_article_author.yaml introduce v1/graphql (fix #1368) (#2064) 2019-05-10 11:35:10 +05:30
nested_select_query_deep.yaml Fix result ordering in some incorrect tests 2019-11-05 15:15:25 -06:00
nested_select_where_query_author_article.yaml Fix result ordering in some incorrect tests 2019-11-05 15:15:25 -06:00
nested_select_with_foreign_key_alter.yaml better change detection when altering foreign key constraints (fix #2060) (#2252) 2019-06-03 15:51:55 +05:30
nodes_aggregates_conditions_mssql.yaml server/mssql: restrict "count" aggregate query on multiple columns 2022-01-18 14:54:46 +00:00
nodes_aggregates_mssql.yaml MSSQL: __typename error and json based aggregates (graphql-engine#7130) 2021-07-30 09:03:57 +00:00
schema_setup_citus.yaml server/citus: feature branch 2021-05-21 02:47:51 +00:00
schema_setup_mssql.yaml MSSQL nodes aggregates & inherited roles 2021-07-08 20:50:09 +00:00
schema_teardown_citus.yaml server/citus: feature branch 2021-05-21 02:47:51 +00:00
schema_teardown_mssql.yaml MSSQL nodes aggregates & inherited roles 2021-07-08 20:50:09 +00:00
select_multiple_columns_arr_fkey.yaml server/citus: feature branch 2021-05-21 02:47:51 +00:00
select_multiple_columns_obj_fkey.yaml server/citus: feature branch 2021-05-21 02:47:51 +00:00
select_placeholder_err.yaml server: use placeholder to prevent empty query roots 2022-01-27 18:08:11 +00:00
select_query_author_by_pkey_null.yaml server/mssql: fix table_by_pk query returning empty array 2021-11-10 05:32:41 +00:00
select_query_author_by_pkey.yaml Fix result ordering in some incorrect tests 2019-11-05 15:15:25 -06:00
select_query_author_col_not_present_err.yaml introduce v1/graphql (fix #1368) (#2064) 2019-05-10 11:35:10 +05:30
select_query_author_col_quoted.yaml server: generalize integration tests 2021-03-11 18:18:41 +00:00
select_query_author_include_directive.yaml Add tests for directives skip and include and basic tests for fragments (fix #3180) (#3185) 2019-10-20 06:59:41 -05:00
select_query_author_skip_directive.yaml Add tests for directives skip and include and basic tests for fragments (fix #3180) (#3185) 2019-10-20 06:59:41 -05:00
select_query_author_skip_include_directives.yaml server: support for custom directives 2021-05-20 10:03:50 +00:00
select_query_author_v1alpha1.yaml server/bigquery: improve test setup and documentation (close #2345) 2021-10-12 17:59:44 +00:00
select_query_author_where.yaml Fix result ordering in some incorrect tests 2019-11-05 15:15:25 -06:00
select_query_author_wrong_directive_err.yaml server: support for custom directives 2021-05-20 10:03:50 +00:00
select_query_author.yaml server/bigquery: improve test setup and documentation (close #2345) 2021-10-12 17:59:44 +00:00
select_query_batching_with_mutation.yaml Report errors in parallel when batching (#3605) 2019-12-30 17:18:20 -06:00
select_query_batching_with_one_error.yaml Report errors in parallel when batching (#3605) 2019-12-30 17:18:20 -06:00
select_query_batching.yaml Support batched queries (fix #1812) (#3490) 2019-12-20 10:04:02 -06:00
select_query_fragment_cycles.yaml Rewrite GraphQL schema generation and query parsing (close #2801) (#4111) 2020-08-21 12:27:01 -05:00
select_query_fragment_with_variable.yaml server: allow fragments to use variables (fix hasura/graphql-engine#6303) (#225) 2020-12-22 10:42:34 +00:00
select_query_invalid_escape_sequence.yaml capture Postgres error code 22025 as HTTP 400 bad request (close #2486) (#2671) 2019-08-08 15:57:42 -05:00
select_query_nested_fragment.yaml Add tests for directives skip and include and basic tests for fragments (fix #3180) (#3185) 2019-10-20 06:59:41 -05:00
select_query_non_tracked_table_err.yaml introduce v1/graphql (fix #1368) (#2064) 2019-05-10 11:35:10 +05:30
select_query_person_citext.yaml fix casting citext column type (fix #2818) (#3861) 2020-02-11 16:02:13 +05:30
select_query_test_types_mssql.yaml server: generalize integration tests 2021-03-11 18:18:41 +00:00
select_query_test_types_postgres.yaml server: generalize integration tests 2021-03-11 18:18:41 +00:00
select_query_top_level_fragment.yaml Add tests for directives skip and include and basic tests for fragments (fix #3180) (#3185) 2019-10-20 06:59:41 -05:00
select_query_user_col_change_mssql.yaml server: split TestGraphQLQueryBasic into common and backend-specific test classes 2021-03-16 16:42:20 +00:00
select_query_user_col_change_postgres.yaml server: split TestGraphQLQueryBasic into common and backend-specific test classes 2021-03-16 16:42:20 +00:00
select_query_user_mssql.yaml server: split TestGraphQLQueryBasic into common and backend-specific test classes 2021-03-16 16:42:20 +00:00
select_query_user_postgres.yaml server: split TestGraphQLQueryBasic into common and backend-specific test classes 2021-03-16 16:42:20 +00:00
setup_citus.yaml server: improve backend-specific test setup 2021-05-25 13:55:11 +00:00
setup_invalid_fkey_relationship.yaml server/citus: feature branch 2021-05-21 02:47:51 +00:00
setup_mssql.yaml Parse session variables to their correct type in mssql 2021-11-20 09:03:44 +00:00
setup.yaml server/citus: feature branch 2021-05-21 02:47:51 +00:00
teardown_citus.yaml server: improve backend-specific test setup 2021-05-25 13:55:11 +00:00
teardown_mssql.yaml MSSQL nodes aggregates & inherited roles 2021-07-08 20:50:09 +00:00
teardown.yaml server/citus: feature branch 2021-05-21 02:47:51 +00:00