Skip to content

Custom Wrapper #809

@ropwareJB

Description

@ropwareJB

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:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions