graphql-engine/server/src-lib/Hasura/Server
Antoine Leblanc c64f66774b [gardening] remove ToJSON constraint in spockAction (fix #1581)
### Description

The spock handler requires the request type to have a `ToJSON` instance AND a `FromJSON` instance. That's because we parse it from the received bytestring into its proper type.... and call `toJSON` on it to log it. This PR simplifies this, by keeping the intermediate `Value` obtained during parsing, and using it for logging. This has two consequences:

1. it removes the `ToJSON` constraint, which will remove some code down the line (esp. in Metadata)
2. it means we log the actual JSON object query we received, not the result of parsing it, meaning the logged object will contain fields that would have been ignored when parsing the actual value; this is both an upside (more accurate log) and a downside (could be more verbose / more confusing)

### Further work

Should this PR also remove all obsolete ToJSON instances while at it?
How do we test this?

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

GitOrigin-RevId: ae099eea9a671eabadcdf507f993a5ad9433be87
2021-07-05 18:47:55 +00:00
..
API server, console, docs: add update_remote_schema API 2021-06-21 17:42:40 +00:00
Auth server: misc cleanups 2021-06-15 15:06:37 +00:00
Init server: rename inDevelopmentMode -> devMode 2021-05-27 06:52:14 +00:00
Migrate server: source initialization fix 2021-05-31 13:54:59 +00:00
Telemetry server: cleanup of language extensions [gardening] 2021-04-16 06:55:56 +00:00
Version server: reorganise version embedding for fewer [TH] rebuilds 2021-06-29 16:40:47 +00:00
App.hs [gardening] remove ToJSON constraint in spockAction (fix #1581) 2021-07-05 18:47:55 +00:00
Auth.hs server: introduce Hasura.Base (take 2) 2021-05-11 15:19:33 +00:00
CheckUpdates.hs server: simplify JSON instances 2021-01-19 19:15:42 +00:00
Compression.hs server: move Hasura.SQL to Hasura.Backends.Postgres (#6053) 2020-10-27 13:53:49 +00:00
Cors.hs server: support custom URI schemes in CORS config (fix #5818) 2021-05-06 00:53:14 +00:00
Init.hs Postgres Client Cert Update 2021-05-21 01:50:43 +00:00
Logging.hs server: log request type (batched/single) in http-log 2021-07-05 09:46:29 +00:00
Middleware.hs Migrate to GHC 8.10, upgrade dependencies. Closes #4517 2020-05-13 19:13:02 -04:00
Migrate.hs server: source initialization fix 2021-05-31 13:54:59 +00:00
Rest.hs server: log request type (batched/single) in http-log 2021-07-05 09:46:29 +00:00
SchemaUpdate.hs server, multi-tenant: update error logging strategy on pro and multitenant 2021-06-08 12:56:22 +00:00
Telemetry.hs server: switch to a sub-backend approach 2021-04-21 21:45:32 +00:00
Types.hs server: log additional info in the livequery poller logs 2021-06-16 13:28:17 +00:00
Utils.hs Revert "remote schema typename customisation" 2021-06-10 09:57:16 +00:00
Version.hs server: reorganise version embedding for fewer [TH] rebuilds 2021-06-29 16:40:47 +00:00