summaryrefslogtreecommitdiff
path: root/src/Language/GraphQL/Type
diff options
context:
space:
mode:
authorEugen Wissner <belka@caraus.de>2020-06-30 10:28:10 +0200
committerEugen Wissner <belka@caraus.de>2020-06-30 10:28:10 +0200
commit8b164c4844da128dc5119febc3defb1ebdf2cc3a (patch)
tree7c8e297c535f400c185a7b281811410ad94dc982 /src/Language/GraphQL/Type
parent705e506c13b6c0f67ddf0195fa0d3256e7e4f9c3 (diff)
downloadgraphql-8b164c4844da128dc5119febc3defb1ebdf2cc3a.tar.gz
Move Core module out of AST
Diffstat (limited to 'src/Language/GraphQL/Type')
-rw-r--r--src/Language/GraphQL/Type/Definition.hs13
-rw-r--r--src/Language/GraphQL/Type/Directive.hs1
2 files changed, 12 insertions, 2 deletions
diff --git a/src/Language/GraphQL/Type/Definition.hs b/src/Language/GraphQL/Type/Definition.hs
index 1379018..40055e7 100644
--- a/src/Language/GraphQL/Type/Definition.hs
+++ b/src/Language/GraphQL/Type/Definition.hs
@@ -2,7 +2,8 @@
-- | Types that can be used as both input and output types.
module Language.GraphQL.Type.Definition
- ( EnumType(..)
+ ( Arguments(..)
+ , EnumType(..)
, EnumValue(..)
, ScalarType(..)
, Subs
@@ -40,6 +41,16 @@ instance IsString Value where
-- and the value is the variable value.
type Subs = HashMap Name Value
+-- | Argument list.
+newtype Arguments = Arguments (HashMap Name Value)
+ deriving (Eq, Show)
+
+instance Semigroup Arguments where
+ (Arguments x) <> (Arguments y) = Arguments $ x <> y
+
+instance Monoid Arguments where
+ mempty = Arguments mempty
+
-- | Scalar type definition.
--
-- The leaf values of any request and input values to arguments are Scalars (or
diff --git a/src/Language/GraphQL/Type/Directive.hs b/src/Language/GraphQL/Type/Directive.hs
index 017132c..6ff73d4 100644
--- a/src/Language/GraphQL/Type/Directive.hs
+++ b/src/Language/GraphQL/Type/Directive.hs
@@ -7,7 +7,6 @@ module Language.GraphQL.Type.Directive
import qualified Data.HashMap.Strict as HashMap
import Language.GraphQL.AST (Name)
-import Language.GraphQL.AST.Core
import Language.GraphQL.Type.Definition
-- | Directive.