graphql-engine/server/src-lib/Hasura/Base
Robert 565e816716 server: don't use Show to encode error codes
This moves the previous (illegal) `Show` instance for `Hasura.Base.Error.Code` to a `ToJSON`
instance, and uses that in the error `ToJSON` instances.

Addressing https://github.com/hasura/graphql-engine-mono/pull/2277#issuecomment-911557169.
This PR is against #2277.

It adds a replacement derived `Show` instance, which is used:
- in the derived `Show` instance for `QErr`
- in some unit tests

Mostly verified that we didn't otherwise rely on the hand-rolled `Show`
instance by compiling without it (and a faked `QErr` instance), and seeing
that the only compile failures were in tests. (Compare the individual commits.)

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

GitOrigin-RevId: 678fe241a14bd0c9aaf5b267efc510ad9d619dd7
2021-09-06 15:49:56 +00:00
..
Error.hs server: don't use Show to encode error codes 2021-09-06 15:49:56 +00:00
Instances.hs Clean some instances 2021-07-30 15:43:32 +00:00
README.md server: introduce Hasura.Base (take 2) 2021-05-11 15:19:33 +00:00

Hasura.Base

This sub-module contains all code that has no internal dependency except for our custom Prelude: either libraries that are too Hasura-specific to be moved to a dedicated folder outside of Hasura, or type definitions that are used throughout the entire codebase.