graphql-engine-1.0.0: GraphQL API over Postgres
Safe HaskellNone
LanguageHaskell2010

Hasura.RQL.Types.Metadata.Serialization

Description

Helpers used in the implementations of metadataToOrdJSON and metadataToDTO

Synopsis

Documentation

ifNotEmpty :: (a -> Bool) -> (a -> b) -> a -> Maybe b Source #

listToMaybeOrdPairSort :: (Foldable t, Ord b) => Text -> (a -> Value) -> (a -> b) -> t a -> Maybe (Text, Value) Source #

Sort list before encoding to JSON value

listToMaybeArraySort :: (Foldable t, Ord b) => (a -> Value) -> (a -> b) -> t a -> Maybe Array Source #

Sort list before encoding to JSON array (not value)

listToMaybeOrdPair :: Foldable t => Text -> (a -> Value) -> t a -> Maybe (Text, Value) Source #

maybeAnyToMaybeOrdPair :: Text -> (a -> Value) -> Maybe a -> Maybe (Text, Value) Source #