haskell-graphql / graphql-api

Write type-safe GraphQL services in Haskell
BSD 3-Clause "New" or "Revised" License
406 stars 35 forks source link

Quasiquoting / TH support #147

Open jml opened 6 years ago

jml commented 6 years ago

It would be nice to just embed a GraphQL schema in Haskell code and then have a computer do most of the work to translating it to Haskell types. I don't know if this is even possible, but it's worth a shot.

Motivation is that it's a little bit tricky to remember how to map GraphQL schemas to Haskell types (how do I do defaults?). Probably the difficulty in implementing will be mapping GraphQL type names to Haskell types.

I guess an alternative to a quasiquoter would be a one-off code generator.

Probably do this as a different library, but in this repo.