renderSubscribe :: WFilePath -> SubscriptionName -> Expression -> [SubscribeParams -> SubscribeParams] -> [FileFieldLabel] -> BSERValue
renderSubscribe rootPath (SubscriptionName subscriptionName) expr params fileFieldLabels =
    BSERArray $ Seq.fromList
        [ BSERString "subscribe"
        , BSERString (toByteString rootPath)
        , BSERString subscriptionName
        , BSERObject $ M.unions
            [ renderFieldLabels fileFieldLabels
            , M.singleton "expression" (renderExpression expr)
            , renderSubscribeParams params'
            ]
        ]
    where
    params' = foldl' (\x f -> f x) defaultSubscribeParams params
renderSubscribe :: WFilePath -> SubscriptionName -> Expression -> [SubscribeParams -> SubscribeParams] -> [FileFieldLabel] -> BSERValue
renderSubscribe rootPath (SubscriptionName subscriptionName) expr params fileFieldLabels =
    BSERArray $ Seq.fromList
        [ BSERString "subscribe"
        , BSERString (toByteString rootPath)
        , BSERString subscriptionName
        , BSERObject $ M.unions
            [ renderFieldLabels fileFieldLabels
            , M.singleton "expression" (renderExpression expr)
            , renderSubscribeParams params'
            ]
        ]
    where
    params' = foldl' (\x f -> f x) defaultSubscribeParams params
renderSubscribe rootPath (SubscriptionName subscriptionName) expr params fileFieldLabels =
    BSERArray $ Seq.fromList
        [ BSERString "subscribe"
        , BSERString (toByteString rootPath)
        , BSERString subscriptionName
        , BSERObject $ M.unions
            [ renderFieldLabels fileFieldLabels
            , M.singleton "expression" (renderExpression expr)
            , renderSubscribeParams params'
            ]
        ]
    where
    params' = foldl' (\x f -> f x) defaultSubscribeParams params