graphql-engine/server/tests-py/queries
Antoine Leblanc b4f7e96665 Rewrite GraphQL.Analysis
### Motivation

While we strive to write clear code, we have historically struggled at Hasura with having very different styles and standards across the codebase. There's been efforts to standardize our coding style, we have an official styleguide that isn't maintained as closely as it should... We still have some work in front of us.

However, in the last ~year or so, there's been a huge push towards incrementally improving the situation. As part of this we've been blocking PRs that don't add enough comments, or don't improve the files that they touch.

While looking at `Hasura.GraphQL.Analyse`, it became apparent that this file did not meet the engineering standards that I would expect to see addressed during a code review. Some ways in which I think it falls short:
- lack of documentation
- no clear distinction between public / internal components
- "unidiomatic" Haskell code (such as using `Either Result Error`)

While there's no problem with a file looking like this during development, those issues should have been caught at review time. The fact that they weren't indicates a problem in our process that we will need to address: code quality and maintainability is paramount, and we all need to do our part.

### Description

This PR rewrites all of `Hasura.GraphQL.Analyze`, and adapts `Hasura.Server.OpenAPI` accordingly where needed. I've attempted to clarify names and add documentation based on my understanding of the code, and to clean what was unused (such as field variables). I don't think this PR is good enough as is, and I welcome criticism where I got my comments wrong / am happy to help y'all add more.

This PR makes one small change in the way error messages are reported (and adjusts the corresponding test accordingly); each error message is now prefixed with the path within the selection set:
```
⚠️ $.test.foo.bar.baz.mizpelled: field 'mizpelled' not found in object 'Baz'
```

### Note

This PR is currently **on top of #3962**. You can preview the changes in isolation by [diffing the branches](https://github.com/hasura/graphql-engine-mono/compare/nicuveo/clean-rest-endpoint-inconsistency-check..nicuveo/rewrite-analysis).

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3963
Co-authored-by: paritosh-08 <85472423+paritosh-08@users.noreply.github.com>
GitOrigin-RevId: 5ec38e0e753f0c12096a350db0737658495e2f15
2022-04-04 05:54:59 +00:00
..
actions Nested action joins 2022-03-03 03:44:20 +00:00
compression [server] coalesce multiple run_sql calls in tests (#270) 2021-01-06 16:07:22 +00:00
endpoints Rewrite GraphQL.Analysis 2022-04-04 05:54:59 +00:00
event_triggers Bug fix/webhook transforms header filtering 2022-03-01 22:55:46 +00:00
explain server/bigquery: apply 'order by' to 'array_agg' projection inside an array relationship join sub-query 2022-03-07 10:13:02 +00:00
graphql_introspection Customize column GraphQL schema descriptions 2022-03-09 06:35:46 +00:00
graphql_mutation server/mssql: Implement column presets 2022-03-14 15:35:15 +00:00
graphql_query server/tests: unify HASURA_BIGQUERY_SERVICE_KEY and HASURA_BIGQUERY_SERVICE_ACCOUNT env vars 2022-03-14 07:50:35 +00:00
graphql_validation server: unify parsing Postgres scalars 2021-05-13 20:13:49 +00:00
heterogeneous [server] coalesce multiple run_sql calls in tests (#270) 2021-01-06 16:07:22 +00:00
horizontal_scale/basic sync metadata cache across multiple instances connected to same db (closes #1182) (#1574) 2019-03-12 11:16:27 +05:30
inconsistent_objects server: include more detail in inconsistent metadata error messages (fix #6684) 2021-05-19 05:02:53 +00:00
logging [server] coalesce multiple run_sql calls in tests (#270) 2021-01-06 16:07:22 +00:00
openapi Rewrite GraphQL.Analysis 2022-04-04 05:54:59 +00:00
query_cache server: disable caching for actions with forward client headers enabled 2021-04-13 07:01:34 +00:00
remote_schemas Customize column GraphQL schema descriptions 2022-03-09 06:35:46 +00:00
scheduled_triggers server: fix flaky test_check_events_statuses test 2021-10-22 05:55:59 +00:00
schema/duplication Fix/custom table name 2021-05-18 13:37:27 +00:00
subscriptions (Fix #8267) Handle subscriptions in MSSQL when results exceed 2048 characters 2022-03-21 12:16:14 +00:00
unauthorized_role Adding multiple jwt secrets (incorporating provenance requirements) 2022-02-13 23:34:39 +00:00
v1 server/tests: unify HASURA_BIGQUERY_SERVICE_KEY and HASURA_BIGQUERY_SERVICE_ACCOUNT env vars 2022-03-14 07:50:35 +00:00
v2 server/mssql: improve database exception handling and better API errors 2022-02-07 14:12:55 +00:00
webhooks/request_context pass gql requests into auth webhook POST body (#149) 2021-02-03 07:11:39 +00:00
clear_db_bigquery.yaml Feature/bigquery python tests 2021-04-22 11:32:55 +00:00
clear_db_citus.yaml server/citus: feature branch 2021-05-21 02:47:51 +00:00
clear_db_mssql.yaml server: generalize integration tests 2021-03-11 18:18:41 +00:00
clear_db.yaml python based tests (#387) 2018-09-18 11:51:57 +05:30