summaryrefslogtreecommitdiff
path: root/Data/GraphQL/AST.hs
diff options
context:
space:
mode:
authortimmy_tofu <timmytofu@users.noreply.github.com>2015-09-25 19:12:22 -0400
committertimmy_tofu <timmytofu@users.noreply.github.com>2015-09-25 19:12:22 -0400
commit85941139c19348de2876f9376bb886d0ebd2eb50 (patch)
tree5208f8b2e475ccb9b503dbcd073526c38cfc11be /Data/GraphQL/AST.hs
parent0848e65da2be6a461f10bece76c1bdabcb585082 (diff)
downloadgraphql-85941139c19348de2876f9376bb886d0ebd2eb50.tar.gz
Adds IsString instance to Variable for easier REPL playing
Diffstat (limited to 'Data/GraphQL/AST.hs')
-rw-r--r--Data/GraphQL/AST.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/Data/GraphQL/AST.hs b/Data/GraphQL/AST.hs
index cc631e6..4140c9c 100644
--- a/Data/GraphQL/AST.hs
+++ b/Data/GraphQL/AST.hs
@@ -1,7 +1,8 @@
module Data.GraphQL.AST where
import Data.Int (Int32)
-import Data.Text (Text)
+import Data.Text (Text, pack)
+import Data.String
-- * Name
@@ -28,6 +29,9 @@ data VariableDefinition = VariableDefinition Variable Type (Maybe DefaultValue)
newtype Variable = Variable Name deriving (Eq,Show)
+instance IsString Variable where
+ fromString = Variable . pack
+
type SelectionSet = [Selection]
data Selection = SelectionField Field