graphql-engine/server/src-test/Hasura/Base/Error/TestInstances.hs
Samir Talwar f01c7f4ee6 server: Remove QErr and Code dependencies from the schema parsers.
In the process of decoupling the schema parsers from the GraphQL Engine, we need to remove dependencies on `Hasura.Base.Error`.

First of all, we have avoided using `QErr` in schema parsers code, instead returning a more appropriate data type which can be converted to a `Hasura.Base.Error.QErr` later.

Secondly, we create a new `ParseErrorCode` type to represent parse failure types, which are then converted to a `Hasura.Base.Error.Code` later.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5181
GitOrigin-RevId: 8655e26adb1e7d5e3d552c77a8a403f987b53467
2022-07-27 12:26:44 +00:00

12 lines
296 B
Haskell

{-# OPTIONS_GHC -Wno-orphans #-}
module Hasura.Base.Error.TestInstances () where
import Data.Text qualified as Text
import Hasura.Base.Error
import Hasura.Prelude
-- Orphan instance so that we can write assertions over 'Either QErr a'.
instance Show QErr where
show = Text.unpack . showQErr