server/pro/cloud: add resolved connection template context in error response in dev mode

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8541
GitOrigin-RevId: 57f97ac336be8e656dcfcf4e339ad2ccc5c62393
This commit is contained in:
Rakesh Emmadi 2023-03-30 17:37:39 +05:30 committed by hasura-bot
parent 0d078f2aca
commit 454fbc7f69
2 changed files with 16 additions and 3 deletions

View File

@ -178,9 +178,11 @@ it might not be the latest version of the Console.
The Hasura GraphQL Engine may provide additional information for each
object in the `extensions` key of `errors`. The `internal` key contains
error information including the generated SQL statement and exception
information from Postgres. This can be highly useful, especially in the
case of debugging errors in [action](/actions/debugging.mdx) requests.
error information including the generated SQL statement, exception
information from Postgres and, if applicable, resolved
[connection template](/databases/database-config/dynamic-db-connection.mdx#connection-template)
information. This can be highly useful, especially in the case of
debugging errors in [Action](/actions/debugging.mdx) requests.
By default the `internal` key is not sent in the `extensions` response
(except for `admin` roles). To enable this, start the GraphQL Engine

View File

@ -1,4 +1,5 @@
{-# LANGUAGE Arrows #-}
{-# LANGUAGE TemplateHaskell #-}
module Hasura.Base.Error
( Code (..),
@ -49,10 +50,16 @@ module Hasura.Base.Error
indexedForM_,
indexedMapM_,
indexedTraverseA_,
-- Lens related
qeInternalLens,
_ExtraExtensions,
_ExtraInternal,
_HideInconsistencies,
)
where
import Control.Arrow.Extended
import Control.Lens (makeLensesFor, makePrisms)
import Data.Aeson
import Data.Aeson.Internal
import Data.Aeson.Key qualified as K
@ -446,3 +453,7 @@ runAesonParser p =
decodeValue :: (FromJSON a, QErrM m) => Value -> m a
decodeValue = liftIResult . ifromJSON
-- Template haskell code
$(makeLensesFor [("qeInternal", "qeInternalLens")] ''QErr)
$(makePrisms ''QErrExtra)