diff options
| author | Eugen Wissner <belka@caraus.de> | 2020-09-30 05:14:52 +0200 |
|---|---|---|
| committer | Eugen Wissner <belka@caraus.de> | 2020-09-30 05:14:52 +0200 |
| commit | 56b63f1c3eda70e6de5da4b6395b98a378b1e4e7 (patch) | |
| tree | e6815d9e5ab30f9639f69840832a2effa9f3bcdc /src/Language/GraphQL/AST/Document.hs | |
| parent | 466416d4b00ab48aaab36eea9623a8aaad366fa8 (diff) | |
| download | graphql-56b63f1c3eda70e6de5da4b6395b98a378b1e4e7.tar.gz | |
Validate input object field names
Diffstat (limited to 'src/Language/GraphQL/AST/Document.hs')
| -rw-r--r-- | src/Language/GraphQL/AST/Document.hs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/Language/GraphQL/AST/Document.hs b/src/Language/GraphQL/AST/Document.hs index c870580..0b118af 100644 --- a/src/Language/GraphQL/AST/Document.hs +++ b/src/Language/GraphQL/AST/Document.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE ExplicitForAll #-} {-# LANGUAGE OverloadedStrings #-} -- | This module defines an abstract syntax tree for the @GraphQL@ language. It @@ -72,7 +73,10 @@ instance Ord Location where | otherwise = compare thisColumn thatColumn -- | Contains some tree node with a location. -data Node a = Node a Location deriving (Eq, Show) +data Node a = Node + { value :: a + , location :: Location + } deriving (Eq, Show) -- ** Document @@ -258,7 +262,7 @@ data ObjectField a = ObjectField Name a Location -- Variables are usually passed along with the query, but not in the query -- itself. They make queries reusable. data VariableDefinition = - VariableDefinition Name Type (Maybe ConstValue) Location + VariableDefinition Name Type (Maybe (Node ConstValue)) Location deriving (Eq, Show) -- ** Type References @@ -484,8 +488,8 @@ instance Monoid ArgumentsDefinition where -- @ -- -- The input type "Point2D" contains two value definitions: "x" and "y". -data InputValueDefinition - = InputValueDefinition Description Name Type (Maybe ConstValue) [Directive] +data InputValueDefinition = InputValueDefinition + Description Name Type (Maybe (Node ConstValue)) [Directive] deriving (Eq, Show) -- ** Unions |
