Fix strigified JSON for the prepared_argument in query_log (#5615)

Fix the `toJson` instance of `PreparedSql` to use
`pgScalarValueToJson` instead of `txtEncodedPGVal`

Fixes: https://github.com/hasura/graphql-engine/issues/5582
This commit is contained in:
Naveen Naidu 2020-08-19 22:23:46 +05:30 committed by GitHub
parent ea76e7840e
commit fa944b18dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -281,7 +281,7 @@ data PreparedSql
instance J.ToJSON PreparedSql where
toJSON (PreparedSql q prepArgs _) =
J.object [ "query" J..= Q.getQueryText q
, "prepared_arguments" J..= map (txtEncodedPGVal . snd) prepArgs
, "prepared_arguments" J..= map (pgScalarValueToJson . snd) prepArgs
]
-- | Intermediate reperesentation of a computed SQL statement and prepared