Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom Wrapper #809

Open
ropwareJB opened this issue Jan 29, 2023 · 0 comments
Open

Custom Wrapper #809

ropwareJB opened this issue Jan 29, 2023 · 0 comments

Comments

@ropwareJB
Copy link
Contributor

ropwareJB commented Jan 29, 2023

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:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant