From 347d65e66bc0ec120973145d346b0e7596a914fc Mon Sep 17 00:00:00 2001 From: Alexis King Date: Tue, 12 Nov 2019 15:29:14 -0600 Subject: [PATCH] Add missing call to withConstructorFn in live queries (fix #3239) --- server/src-lib/Hasura/GraphQL/Execute/LiveQuery/Plan.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/server/src-lib/Hasura/GraphQL/Execute/LiveQuery/Plan.hs b/server/src-lib/Hasura/GraphQL/Execute/LiveQuery/Plan.hs index 30154f2b038a44..46339a5bab732e 100644 --- a/server/src-lib/Hasura/GraphQL/Execute/LiveQuery/Plan.hs +++ b/server/src-lib/Hasura/GraphQL/Execute/LiveQuery/Plan.hs @@ -118,11 +118,13 @@ resolveMultiplexedValue = \case GR.UVSessVar ty sessVar -> pure $ fromResVars ty ["session", T.toLower sessVar] GR.UVSQL sqlExp -> pure sqlExp where - fromResVars ty jPath = - flip S.SETyAnn (S.mkTypeAnn ty) $ S.SEOpApp (S.SQLOp "#>>") + fromResVars pgType jPath = addTypeAnnotation pgType $ S.SEOpApp (S.SQLOp "#>>") [ S.SEQIden $ S.QIden (S.QualIden $ Iden "_subs") (Iden "result_vars") , S.SEArray $ map S.SELit jPath ] + addTypeAnnotation pgType = flip S.SETyAnn (S.mkTypeAnn pgType) . case pgType of + PGTypeScalar scalarType -> withConstructorFn scalarType + PGTypeArray _ -> id newtype CohortId = CohortId { unCohortId :: UUID } deriving (Show, Eq, Hashable, J.ToJSON, Q.FromCol)