Skip to content

Commit

Permalink
Add missing call to withConstructorFn in live queries (fix hasura#3239)
Browse files Browse the repository at this point in the history
  • Loading branch information
lexi-lambda committed Nov 12, 2019
1 parent 98e4cb3 commit 7bfdb15
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions server/src-lib/Hasura/GraphQL/Execute/LiveQuery/Plan.hs
Expand Up @@ -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)
Expand Down

0 comments on commit 7bfdb15

Please sign in to comment.