graphql/Data/GraphQL/Schema.hs
Danny Navarro 4e5dc3433a Implement first StarWars end-to-end test
`execute` still needs to be implemented.
2015-10-19 12:19:39 +02:00

34 lines
821 B
Haskell

module Data.GraphQL.Schema where
import Data.Text (Text)
import Data.HashMap.Lazy (HashMap)
data Schema f = Schema (QueryRoot f) (Maybe (MutationRoot f))
type QueryRoot f = Map f
type MutationRoot f = Map f
type Map f = HashMap Text (Resolver f)
type Resolver f = Input -> Output f
data Output f = OutputScalar (f Scalar)
| OutputMap (Map f)
| OutputUnion [Map f]
| OutputEnum (f Scalar)
| OutputList [Output f]
| OutputNonNull (Output f)
| InputError
data Input = InputScalar Scalar
| InputEnum Scalar
| InputList [Input]
| InputNonNull Input
data Scalar = ScalarInt Int
| ScalarFloat Double
| ScalarString Text
| ScalarBool Bool
| ScalarID Text