graphql-engine/server/src-lib
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
..
Control server: graceful shutdown for event and cron triggers and async action (II) 2021-05-14 09:39:33 +00:00
Data server: misc cleanups 2021-06-15 15:06:37 +00:00
GHC/Stats Add a new /dev/rts_stats endpoint, enabled when '+RTS -T' 2021-04-13 17:33:38 +00:00
Hasura [gardening] remove ToJSON constraint in spockAction (fix #1581) 2021-07-05 18:47:55 +00:00
Network server: RQL code health 2021-01-08 23:10:36 +00:00