graphql-engine/server
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
..
bench-wrk server: generalize integration tests 2021-03-11 18:18:41 +00:00
packaging build: use the debian buster version in the docker image 2021-05-27 07:50:15 +00:00
src-bench-cache server: make more use of hlint (#6059) 2020-10-28 16:40:33 +00:00
src-exec 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
src-lib server: fix major issue with JSON instances of AnyBackend 2021-06-28 18:39:01 +00:00
src-rsr Use exceptions to handle compatibility with pg 9.6 in 2.0 upgrade migration 2021-06-24 02:20:11 +00:00
src-test server: support remote relationships on SQL Server and BigQuery (#1497) 2021-06-11 03:27:39 +00:00
tests-py Bigquery/global limit 2021-06-25 13:36:35 +00:00
.dockerignore update packages (#251) 2018-08-08 13:10:13 +05:30
.gitignore server/citus: feature branch 2021-05-21 02:47:51 +00:00
.hlint.yaml ci: improve hlint messages 2021-05-04 21:52:55 +00:00
.stylish-haskell.yaml ci: run stylish haskell on all incoming PRs 2021-01-21 23:37:26 +00:00
cabal.project server: Updates 'pg-client-hs', fixes explicit conversions 2021-06-18 17:00:24 +00:00
cabal.project.ci update resource limits on circleci [force ci] 2021-01-29 14:36:07 +00:00
cabal.project.dev server: Bump GHC version to 8.10.2 (#5659) 2020-08-26 23:16:23 -05:00
cabal.project.dev-sh dev.sh: restore code coverage functionality 2020-01-23 18:35:18 -05:00
cabal.project.dev-sh.freeze dev.sh: restore code coverage functionality 2020-01-23 18:35:18 -05:00
cabal.project.dev-sh.local ci: improve compilation times by building a dynamic executable 2021-03-22 21:43:43 +00:00
cabal.project.freeze server: graceful shutdown for event and cron triggers and async action (II) 2021-05-14 09:39:33 +00:00
commit_diff.txt Rewrite GraphQL schema generation and query parsing (close #2801) (#4111) 2020-08-21 12:27:01 -05:00
CONTRIBUTING.md update contributing.md with server dependencies 2021-05-25 14:00:33 +00:00
graphql-engine.cabal Bigquery/drop dataloader 2021-06-28 13:30:40 +00:00
Makefile server: add MSSQL support 2021-02-23 17:38:36 +00:00
sample.hie.yaml Merge oss/master onto mono/main 2020-11-12 22:37:19 +05:30
Setup.hs move raven into graphql-engine repo 2018-06-28 00:32:00 +05:30
STYLE.md server: Add a Haskell style guide (#2175) 2020-04-08 02:31:30 -05:00