mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-15 17:31:56 +03:00
c64f66774b
### 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 |
||
---|---|---|
.. | ||
bench-wrk | ||
packaging | ||
src-bench-cache | ||
src-exec | ||
src-lib | ||
src-rsr | ||
src-test | ||
tests-py | ||
.dockerignore | ||
.gitignore | ||
.hlint.yaml | ||
.stylish-haskell.yaml | ||
cabal.project | ||
cabal.project.ci | ||
cabal.project.dev | ||
cabal.project.dev-sh | ||
cabal.project.dev-sh.freeze | ||
cabal.project.dev-sh.local | ||
cabal.project.freeze | ||
commit_diff.txt | ||
CONTRIBUTING.md | ||
graphql-engine.cabal | ||
Makefile | ||
sample.hie.yaml | ||
Setup.hs | ||
STYLE.md |