Merge pull request #2 from timmytofu/isstring-variable

`IsString` variable and .gitignore
This commit is contained in:
Danny Navarro 2015-09-26 09:23:46 +02:00
commit c8f629e826
2 changed files with 8 additions and 1 deletions

3
.gitignore vendored
View File

@ -1 +1,4 @@
.stack-work/ .stack-work/
.cabal-sandbox/
cabal.sandbox.config
dist/

View File

@ -1,7 +1,8 @@
module Data.GraphQL.AST where module Data.GraphQL.AST where
import Data.Int (Int32) import Data.Int (Int32)
import Data.Text (Text) import Data.Text (Text, pack)
import Data.String
-- * Name -- * Name
@ -28,6 +29,9 @@ data VariableDefinition = VariableDefinition Variable Type (Maybe DefaultValue)
newtype Variable = Variable Name deriving (Eq,Show) newtype Variable = Variable Name deriving (Eq,Show)
instance IsString Variable where
fromString = Variable . pack
type SelectionSet = [Selection] type SelectionSet = [Selection]
data Selection = SelectionField Field data Selection = SelectionField Field