graphql-engine/server/src-lib/Hasura/RQL
Antoine Leblanc 404551acdb server: fix major issue with JSON instances of AnyBackend
### Description
This PR fixes a major issue in the JSON instances of `AnyBackend`: they were not symmetrical! `FromJSON` always made the assumption that the value was an object, and that it contained a "kind" field if it happened to not be a Postgres value. `ToJSON` did NOT insert said field in the output, and did not enforce that the output was an object.

....however, it worked, because nowhere in the code did we yet rely on those being symmetrical. They are both used only once:
- `parseJSON` was used to decode a `Metadata` object, but the matching `toJSON` instance, which is heavily customized, does insert the "kind" field properly
- `toJSON` was only used on the `SchemaCache`, which has no corresponding `FromJSON` instance, since we only serialize it in debug endpoints

This PR makes no attempt at making the instances symmetrical. Instead, it implements simpler functions, and pushes the problem of identifying the proper backend (if any) to the call sites.

### Notes

Additionally, it cleans up some instances that were manually written where they could be auto-generated. In the process, this PR changes the semantics of `Show`, since the stock derived instance will include the constructor name, where before it was skipped. I think it is preferable.

https://github.com/hasura/graphql-engine-mono/pull/1672

GitOrigin-RevId: 0a1580a0e0f01c25b8c9fee7612dba6e7de055d5
2021-06-28 18:39:01 +00:00
..
DDL server, console, docs: add update_remote_schema API 2021-06-21 17:42:40 +00:00
DML server: misc cleanups 2021-06-15 15:06:37 +00:00
IR server: IR for DB-DB joins 2021-06-17 23:13:05 +00:00
Types server: fix major issue with JSON instances of AnyBackend 2021-06-28 18:39:01 +00:00
IR.hs server: support remote relationships on SQL Server and BigQuery (#1497) 2021-06-11 03:27:39 +00:00
Types.hs server: fix cron trigger bug of new events not getting generated when cron trigger is imported via metadata 2021-05-26 16:20:19 +00:00