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

Hasura.Metadata.DTO.Utils

Description

Utility functions for use defining autodocodec codecs.

Synopsis

Documentation

versionField :: Integer -> ObjectCodec a Scientific Source #

Defines a required object field named version that must have the given integer value. On serialization the field will have the given value automatically. On deserialization parsing will fail unless the field has the exact given value.

optionalVersionField :: Integer -> ObjectCodec a (Maybe Scientific) Source #

Defines an optional object field named version that must have the given integer value if the field is present. On serialization the field will have the given value automatically. On deserialization parsing will fail unless the field has the exact given value, or is absent.