How do we define a custom record wrapper?
I see that there is the EncodeWrapper and DecodeWrapper type classes, by I'm not sure if this is the full story:
https://hackage.haskell.org/package/morpheus-graphql-0.18.0/docs/Data-Morpheus-Types.html#t:EncodeWrapper
I'd like to be able to use Yesod's Entity datatype:
https://hackage.haskell.org/package/persistent-2.14.0.0/docs/Database-Persist-Class-PersistEntity.html#t:Entity
so that an Entity Person would be serialized to the following:
Entity_Person
{ id :: Int
, model :: Person
}
I am not sure, but it seems to me I am missing context on how TypeData works, and what is relevant there, and how to use it:
How do we define a custom record wrapper?
I see that there is the
EncodeWrapperandDecodeWrappertype classes, by I'm not sure if this is the full story:https://hackage.haskell.org/package/morpheus-graphql-0.18.0/docs/Data-Morpheus-Types.html#t:EncodeWrapper
I'd like to be able to use Yesod's
Entitydatatype:https://hackage.haskell.org/package/persistent-2.14.0.0/docs/Database-Persist-Class-PersistEntity.html#t:Entity
so that an
Entity Personwould be serialized to the following:I am not sure, but it seems to me I am missing context on how TypeData works, and what is relevant there, and how to use it:
morpheus-graphql/morpheus-graphql-server/src/Data/Morpheus/Server/Types/GQLType.hs
Line 140 in f9bd0cb