graphql-engine/server/tests-py/queries
Antoine Leblanc 3a400fab3d Rewrite OpenAPI
### Description

This PR rewrites OpenAPI to be more idiomatic. Some noteworthy changes:
- we accumulate all required information during the Analyze phase, to avoid having to do a single lookup in the schema cache during the OpenAPI generation phase (we now only need the schema cache as input to run the analysis)
- we no longer build intermediary endpoint information and aggregate it, we directly build the the `PathItem` for each endpoint; additionally, that means we no longer have to assume that different methods have the same metadata
- we no longer have to first declare types, then craft references: we do everything in one step
- we now properly deal with nullability by treating "typeName" and "typeName!" as different
- we add a bunch of additional fields in the generated "schema", such as title
- we do now support enum values in both input and output positions
- checking whether the request body is required is now performed on the fly rather than by introspecting the generated schema
- the methods in the file are sorted by topic

### Controversial point

However, this PR creates some additional complexity, that we might not want to keep. The main complexity is _knot-tying_: to avoid lookups when generating the OpenAPI, it builds an actual graph of input types, which means that we need something similar to (but simpler than) `MonadSchema`, to avoid infinite recursions when analyzing the input types of a query. To do this, this PR introduces `CircularT`, a lesser `SchemaT` that aims at avoiding ever having to reinvent this particular wheel ever again.

### Remaining work

- [x] fix existing tests (they are all failing due to some of the schema changes)
- [ ] add tests to cover the new features:
  - [x] tests for `CircularT`
  - [ ] tests for enums in output schemas
- [x] extract / document `CircularT` if we wish to keep it
- [x] add more comments to `OpenAPI`
- [x] have a second look at `buildVariableSchema`
- [x] fix all missing diagnostics in `Analyze`
- [x] add a Changelog entry?

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4654
Co-authored-by: David Overton <7734777+dmoverton@users.noreply.github.com>
GitOrigin-RevId: f4a9191f22dfcc1dccefd6a52f5c586b6ad17172
2022-06-30 12:57:09 +00:00
..
actions Move, document, and prune action types and custom types types. 2022-06-07 15:45:00 +00:00
compression [server] coalesce multiple run_sql calls in tests (#270) 2021-01-06 16:07:22 +00:00
endpoints Fixing URL parameter for variable <name> not supported bug in REST endpoints for Dates 2022-05-02 03:34:34 +00:00
event_triggers server: fix create event trigger failure on tables with MSSQL reserved keywords as name 2022-06-15 17:11:44 +00:00
explain server: migrate to aeson-2 in preparation for ghc 9.2 upgrade 2022-06-08 15:32:27 +00:00
graphql_introspection Customize column GraphQL schema descriptions 2022-03-09 06:35:46 +00:00
graphql_mutation server: migrate to aeson-2 in preparation for ghc 9.2 upgrade 2022-06-08 15:32:27 +00:00
graphql_query Port the "test_user_perms" pytest to hspec 2022-06-30 10:28:08 +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 Remove all functions from RQL.Types.hs 2022-04-26 15:13:57 +00:00
logging [server] coalesce multiple run_sql calls in tests (#270) 2021-01-06 16:07:22 +00:00
naming_conventions server: respect experimental flag for naming convention of table column names 2022-06-30 05:57:18 +00:00
openapi Rewrite OpenAPI 2022-06-30 12:57:09 +00:00
query_cache server: disable caching for actions with forward client headers enabled 2021-04-13 07:01:34 +00:00
remote_schemas server: do not serialize env vars in logs or errors: PR I - Remote Schemas 2022-05-21 09:05:59 +00:00
scheduled_triggers server: fix flaky test_check_events_statuses test 2021-10-22 05:55:59 +00:00
schema/duplication server: Metadata origin for definitions (type parameter version v2) 2022-06-28 15:53:44 +00:00
subscriptions server/postgres: parameterise array variables in queries/subscriptions 2022-06-29 13:37:11 +00:00
unauthorized_role Adding multiple jwt secrets (incorporating provenance requirements) 2022-02-13 23:34:39 +00:00
v1 server: migrate to aeson-2 in preparation for ghc 9.2 upgrade 2022-06-08 15:32:27 +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