summaryrefslogtreecommitdiff
path: root/src/Language/GraphQL/Type
diff options
context:
space:
mode:
Diffstat (limited to 'src/Language/GraphQL/Type')
-rw-r--r--src/Language/GraphQL/Type/Definition.hs7
-rw-r--r--src/Language/GraphQL/Type/Directive.hs1
-rw-r--r--src/Language/GraphQL/Type/Out.hs2
3 files changed, 7 insertions, 3 deletions
diff --git a/src/Language/GraphQL/Type/Definition.hs b/src/Language/GraphQL/Type/Definition.hs
index 0f92857..411a7b3 100644
--- a/src/Language/GraphQL/Type/Definition.hs
+++ b/src/Language/GraphQL/Type/Definition.hs
@@ -3,6 +3,7 @@
-- | Types that can be used as both input and output types.
module Language.GraphQL.Type.Definition
( EnumType(..)
+ , EnumValue(..)
, ScalarType(..)
, Subs
, Value(..)
@@ -15,7 +16,6 @@ module Language.GraphQL.Type.Definition
import Data.Int (Int32)
import Data.HashMap.Strict (HashMap)
-import Data.Set (Set)
import Data.String (IsString(..))
import Data.Text (Text)
import Language.GraphQL.AST.Document (Name)
@@ -51,7 +51,10 @@ data ScalarType = ScalarType Name (Maybe Text)
-- Some leaf values of requests and input values are Enums. GraphQL serializes
-- Enum values as strings, however internally Enums can be represented by any
-- kind of type, often integers.
-data EnumType = EnumType Name (Maybe Text) (Set Text)
+data EnumType = EnumType Name (Maybe Text) (HashMap Name EnumValue)
+
+-- | Enum value is a single member of an 'EnumType'.
+newtype EnumValue = EnumValue (Maybe Text)
-- | The @String@ scalar type represents textual data, represented as UTF-8
-- character sequences. The String type is most often used by GraphQL to
diff --git a/src/Language/GraphQL/Type/Directive.hs b/src/Language/GraphQL/Type/Directive.hs
index 261bf04..017132c 100644
--- a/src/Language/GraphQL/Type/Directive.hs
+++ b/src/Language/GraphQL/Type/Directive.hs
@@ -6,6 +6,7 @@ module Language.GraphQL.Type.Directive
) where
import qualified Data.HashMap.Strict as HashMap
+import Language.GraphQL.AST (Name)
import Language.GraphQL.AST.Core
import Language.GraphQL.Type.Definition
diff --git a/src/Language/GraphQL/Type/Out.hs b/src/Language/GraphQL/Type/Out.hs
index acd348c..9367d54 100644
--- a/src/Language/GraphQL/Type/Out.hs
+++ b/src/Language/GraphQL/Type/Out.hs
@@ -24,7 +24,7 @@ module Language.GraphQL.Type.Out
import Data.HashMap.Strict (HashMap)
import Data.Text (Text)
-import Language.GraphQL.AST.Core
+import Language.GraphQL.AST (Name)
import Language.GraphQL.Trans
import Language.GraphQL.Type.Definition
import qualified Language.GraphQL.Type.In as In