Hey!
I recently started using AWS AppSync which is a Graphql API as a service.
I thought it would be cool if you could create scripts that:
- Set ups a haskell lambda (using https://github.com/Nike-Inc/hal)
The default interpreter is just a function that takes some json input and transforms it to some json output
- Ensure that the types between the AppSync schema and lambda are synced.
Since a graphql query is basically just a function, it should be possible to define a translation from a dhall object, say
let Input: Type = {
name: Text,
email: Text,
age: Natural
}
let Output: Type = Text
To a graphql query
myLambdaFunction(input: Input): Output
Then you could also write scripts to generate correct resolvers and data sources using cloudformation, import that same type in Haskell using dhall+template haskell and that way you can safely ensure that the graphql schema is correct.
Would this be possible in dhall?