From 78e0d871d5abfa920746d9af3c1e13611aea40e6 Mon Sep 17 00:00:00 2001 From: Danny Navarro Date: Tue, 26 Jan 2016 13:38:02 +0100 Subject: [PATCH] Garden --- .gitignore | 2 ++ Data/GraphQL/AST.hs | 6 ++---- Data/GraphQL/Schema.hs | 2 ++ graphql.cabal | 2 +- tests/tasty.hs | 2 +- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 02fa8db..5e97b3c 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,5 @@ .cabal-sandbox/ cabal.sandbox.config dist/ +TAGS +.#* diff --git a/Data/GraphQL/AST.hs b/Data/GraphQL/AST.hs index 4140c9c..1303908 100644 --- a/Data/GraphQL/AST.hs +++ b/Data/GraphQL/AST.hs @@ -1,8 +1,8 @@ module Data.GraphQL.AST where import Data.Int (Int32) +import Data.String (IsString(fromString)) import Data.Text (Text, pack) -import Data.String -- * Name @@ -39,9 +39,7 @@ data Selection = SelectionField Field | SelectionInlineFragment InlineFragment deriving (Eq,Show) -data Field = Field Alias Name [Argument] - [Directive] - SelectionSet +data Field = Field Alias Name [Argument] [Directive] SelectionSet deriving (Eq,Show) type Alias = Name diff --git a/Data/GraphQL/Schema.hs b/Data/GraphQL/Schema.hs index 08ddaa1..795bb19 100644 --- a/Data/GraphQL/Schema.hs +++ b/Data/GraphQL/Schema.hs @@ -6,6 +6,8 @@ import Text.Show.Functions () import Data.Text (Text) import Data.Aeson (ToJSON(toJSON)) +-- TODO: Support side-effects + data Schema = Schema QueryRoot -- (Maybe MutationRoot) type QueryRoot = Resolver diff --git a/graphql.cabal b/graphql.cabal index 267f3eb..7cffa53 100644 --- a/graphql.cabal +++ b/graphql.cabal @@ -14,7 +14,7 @@ copyright: Copyright (C) 2015 J. Daniel Navarro category: Web build-type: Simple cabal-version: >=1.10 -tested-with: GHC == 7.8.4, GHC == 7.10.2 +tested-with: GHC == 7.8.4, GHC == 7.10.3 extra-source-files: README.md CHANGELOG.md stack.yaml data-files: tests/data/*.graphql tests/data/*.min.graphql diff --git a/tests/tasty.hs b/tests/tasty.hs index 1dd9466..f7ed522 100644 --- a/tests/tasty.hs +++ b/tests/tasty.hs @@ -28,6 +28,6 @@ ksTest = testCase "Kitchen Sink" =<< getDataFileName "tests/data/kitchen-sink.min.graphql" actual = either (error "Parsing error!") Encoder.document - <$> parseOnly Parser.document + . parseOnly Parser.document <$> expected