haskell-graphql / graphql-api

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

[WIP] Support for standard JSON post request #210

Closed theobat closed 5 years ago

theobat commented 5 years ago

The purpose of this PR is to fully and automatically support the parsing and validation of a json object of variable values referenced by their names into a VariableValues object. This project is using Aeson already so the interface will use the aeson AST for JSON. The goal is to address #145, #132, and to replace #128

Schematically, the idea is to follow the generation of the schema by a double tree descending job where we compare the GraphQL's expected type and the JSON's observed value to either return an error or return the expected Haskell/GraphQL value. For now, the code will reuse the Validation module and the execution module. The actual variables parsing will be done in the Validation module.

I'm open to any suggestion or help.