Validate required input fields

This commit is contained in:
2020-10-04 18:51:21 +02:00
parent d5f518fe82
commit a91bc7f2d2
9 changed files with 128 additions and 48 deletions

View File

@ -1,5 +1,7 @@
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE ExplicitForAll #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE Safe #-}
-- | This module defines an abstract syntax tree for the @GraphQL@ language. It
@ -75,10 +77,13 @@ instance Ord Location where
-- | Contains some tree node with a location.
data Node a = Node
{ value :: a
{ node :: a
, location :: Location
} deriving (Eq, Show)
instance Functor Node where
fmap f Node{..} = Node (f node) location
-- ** Document
-- | GraphQL document.
@ -241,8 +246,11 @@ data ConstValue
-- | Key-value pair.
--
-- A list of 'ObjectField's represents a GraphQL object type.
data ObjectField a = ObjectField Name a Location
deriving (Eq, Show)
data ObjectField a = ObjectField
{ name :: Name
, value :: Node a
, location :: Location
} deriving (Eq, Show)
-- ** Variables