graphql/Data/GraphQL/Schema.hs
Danny Navarro 3f30a44d1d Test fixtures for Schema toplevel
This includes simplications to the Schema data types.
2015-10-17 17:49:56 +02:00

37 lines
912 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 = Object f
type MutationRoot f = Object f
type Object f = HashMap Text (Input -> f Output)
type ObjectInput = HashMap Text Input
data Output = OutputScalar Scalar
| OutputObject (HashMap Text Output)
| OutputUnion [Output]
| OutputEnum Scalar
| OutputList [Output]
| OutputNonNull Output
| InputError
data Input = InputScalar Scalar
| InputObject ObjectInput
| InputEnum Scalar
| InputList [Output]
| InputNonNull Input
data Scalar = ScalarInt Int
| ScalarFloat Double
| ScalarString Text
| ScalarBool Bool
| ScalarID Text
newtype Interface f = Interface (Object f)