diff --git a/graphql.cabal b/graphql.cabal index 00a05b0..0f9c866 100644 --- a/graphql.cabal +++ b/graphql.cabal @@ -4,15 +4,15 @@ cabal-version: 1.12 -- -- see: https://github.com/sol/hpack -- --- hash: 3b6e8e64a62fa7a1ef602db8cb6aec07bfb21e81af7c91c939bfa03833879a81 +-- hash: 20a76d38355648944315f3aa937e5cd72837bbd1b93037f53e2849906de3f2c0 name: graphql version: 0.4.0.0 synopsis: Haskell GraphQL implementation -description: This package provides a rudimentary parser for the language. -category: Web +description: This package provides a rudimentary parser for the language. +category: Language homepage: https://github.com/jdnavarro/graphql-haskell -bug-reports: https://github.com/jdnavarro/graphql-haskell/issues +bug-reports: https://github.com/caraus-ecms/graphql/issues author: Danny Navarro , Matthías Páll Gissurarson , Sólrún Halla Einarsdóttir @@ -34,20 +34,20 @@ data-files: source-repository head type: git - location: https://github.com/jdnavarro/graphql-haskell + location: https://github.com/caraus-ecms/graphql library exposed-modules: - Data.GraphQL - Data.GraphQL.AST - Data.GraphQL.AST.Core - Data.GraphQL.AST.Transform - Data.GraphQL.Encoder - Data.GraphQL.Error - Data.GraphQL.Execute - Data.GraphQL.Parser - Data.GraphQL.Schema + Language.GraphQL + Language.GraphQL.AST + Language.GraphQL.AST.Core + Language.GraphQL.AST.Transform + Language.GraphQL.Encoder + Language.GraphQL.Error + Language.GraphQL.Execute Language.GraphQL.Lexer + Language.GraphQL.Parser + Language.GraphQL.Schema Language.GraphQL.Trans Language.GraphQL.Type other-modules: @@ -58,7 +58,6 @@ library aeson , base >=4.7 && <5 , megaparsec - , scientific , text , transformers , unordered-containers @@ -86,5 +85,4 @@ test-suite tasty , tasty-hunit , text , transformers - , unordered-containers default-language: Haskell2010 diff --git a/package.yaml b/package.yaml index a15102c..50f709a 100644 --- a/package.yaml +++ b/package.yaml @@ -3,14 +3,14 @@ version: 0.4.0.0 synopsis: Haskell GraphQL implementation description: This package provides a rudimentary parser for the - language. + language. homepage: https://github.com/jdnavarro/graphql-haskell maintainer: belka@caraus.de -copyright: -- 2019 Eugen Wissner -- 2015-2017 J. Daniel Navarro -category: Web github: caraus-ecms/graphql +category: Language +copyright: +- (c) 2019 Eugen Wissner +- (c) 2015-2017 J. Daniel Navarro author: - Danny Navarro - Matthías Páll Gissurarson @@ -33,12 +33,11 @@ dependencies: - megaparsec - text - transformers -- unordered-containers library: source-dirs: src dependencies: - - scientific + - unordered-containers tests: tasty: diff --git a/src/Data/GraphQL.hs b/src/Language/GraphQL.hs similarity index 88% rename from src/Data/GraphQL.hs rename to src/Language/GraphQL.hs index 47ca2b0..8ed29cf 100644 --- a/src/Data/GraphQL.hs +++ b/src/Language/GraphQL.hs @@ -1,5 +1,5 @@ -- | This module provides the functions to parse and execute @GraphQL@ queries. -module Data.GraphQL where +module Language.GraphQL where import Control.Monad (MonadPlus) @@ -10,11 +10,11 @@ import Text.Megaparsec ( errorBundlePretty , parse ) -import Data.GraphQL.Execute -import Data.GraphQL.Parser -import Data.GraphQL.Schema +import Language.GraphQL.Execute +import Language.GraphQL.Parser +import Language.GraphQL.Schema -import Data.GraphQL.Error +import Language.GraphQL.Error -- | Takes a 'Schema' and text representing a @GraphQL@ request document. -- If the text parses correctly as a @GraphQL@ query the query is diff --git a/src/Data/GraphQL/AST.hs b/src/Language/GraphQL/AST.hs similarity index 98% rename from src/Data/GraphQL/AST.hs rename to src/Language/GraphQL/AST.hs index 3378655..618bd4b 100644 --- a/src/Data/GraphQL/AST.hs +++ b/src/Language/GraphQL/AST.hs @@ -3,7 +3,7 @@ -- -- Target AST for Parser. -module Data.GraphQL.AST where +module Language.GraphQL.AST where import Data.Int (Int32) import Data.List.NonEmpty (NonEmpty) diff --git a/src/Data/GraphQL/AST/Core.hs b/src/Language/GraphQL/AST/Core.hs similarity index 95% rename from src/Data/GraphQL/AST/Core.hs rename to src/Language/GraphQL/AST/Core.hs index f0c617c..be432a8 100644 --- a/src/Data/GraphQL/AST/Core.hs +++ b/src/Language/GraphQL/AST/Core.hs @@ -1,5 +1,5 @@ -- | This is the AST meant to be executed. -module Data.GraphQL.AST.Core where +module Language.GraphQL.AST.Core where import Data.Int (Int32) import Data.List.NonEmpty (NonEmpty) diff --git a/src/Data/GraphQL/AST/Transform.hs b/src/Language/GraphQL/AST/Transform.hs similarity index 95% rename from src/Data/GraphQL/AST/Transform.hs rename to src/Language/GraphQL/AST/Transform.hs index af55772..22a9c4c 100644 --- a/src/Data/GraphQL/AST/Transform.hs +++ b/src/Language/GraphQL/AST/Transform.hs @@ -1,5 +1,5 @@ {-# LANGUAGE OverloadedStrings #-} -module Data.GraphQL.AST.Transform where +module Language.GraphQL.AST.Transform where import Control.Applicative (empty) import Control.Monad ((<=<)) @@ -8,12 +8,10 @@ import Data.Either (partitionEithers) import Data.Foldable (fold, foldMap) import qualified Data.List.NonEmpty as NonEmpty import Data.Monoid (Alt(Alt,getAlt), (<>)) - import Data.Text (Text) - -import qualified Data.GraphQL.AST as Full -import qualified Data.GraphQL.AST.Core as Core -import qualified Data.GraphQL.Schema as Schema +import qualified Language.GraphQL.AST as Full +import qualified Language.GraphQL.AST.Core as Core +import qualified Language.GraphQL.Schema as Schema type Name = Text diff --git a/src/Data/GraphQL/Encoder.hs b/src/Language/GraphQL/Encoder.hs similarity index 98% rename from src/Data/GraphQL/Encoder.hs rename to src/Language/GraphQL/Encoder.hs index 924bdea..de5e2bb 100644 --- a/src/Data/GraphQL/Encoder.hs +++ b/src/Language/GraphQL/Encoder.hs @@ -1,14 +1,12 @@ {-# LANGUAGE OverloadedStrings #-} -- | This module defines a printer for the @GraphQL@ language. -module Data.GraphQL.Encoder where +module Language.GraphQL.Encoder where import Data.Foldable (fold) import Data.Monoid ((<>)) import qualified Data.List.NonEmpty as NonEmpty (toList) - import Data.Text (Text, cons, intercalate, pack, snoc) - -import Data.GraphQL.AST +import Language.GraphQL.AST -- * Document diff --git a/src/Data/GraphQL/Error.hs b/src/Language/GraphQL/Error.hs similarity index 98% rename from src/Data/GraphQL/Error.hs rename to src/Language/GraphQL/Error.hs index 08d1622..c2338b1 100644 --- a/src/Data/GraphQL/Error.hs +++ b/src/Language/GraphQL/Error.hs @@ -1,5 +1,5 @@ {-# LANGUAGE OverloadedStrings #-} -module Data.GraphQL.Error +module Language.GraphQL.Error ( parseError , CollectErrsT , addErr diff --git a/src/Data/GraphQL/Execute.hs b/src/Language/GraphQL/Execute.hs similarity index 80% rename from src/Data/GraphQL/Execute.hs rename to src/Language/GraphQL/Execute.hs index e6bb1c9..eb53bba 100644 --- a/src/Data/GraphQL/Execute.hs +++ b/src/Language/GraphQL/Execute.hs @@ -1,18 +1,18 @@ {-# LANGUAGE OverloadedStrings #-} -- | This module provides the function to execute a @GraphQL@ request -- -- according to a 'Schema'. -module Data.GraphQL.Execute (execute) where +module Language.GraphQL.Execute (execute) where import Control.Monad (MonadPlus(..)) -import Data.GraphQL.Error import qualified Data.List.NonEmpty as NE import Data.List.NonEmpty (NonEmpty((:|))) import qualified Data.Aeson as Aeson -import qualified Data.GraphQL.AST as AST -import qualified Data.GraphQL.AST.Core as AST.Core -import qualified Data.GraphQL.AST.Transform as Transform -import Data.GraphQL.Schema (Schema) -import qualified Data.GraphQL.Schema as Schema +import qualified Language.GraphQL.AST as AST +import qualified Language.GraphQL.AST.Core as AST.Core +import qualified Language.GraphQL.AST.Transform as Transform +import Language.GraphQL.Error +import Language.GraphQL.Schema (Schema) +import qualified Language.GraphQL.Schema as Schema -- | Takes a 'Schema', a variable substitution function ('Schema.Subs'), and a -- @GraphQL@ 'document'. The substitution is applied to the document using diff --git a/src/Data/GraphQL/Parser.hs b/src/Language/GraphQL/Parser.hs similarity index 98% rename from src/Data/GraphQL/Parser.hs rename to src/Language/GraphQL/Parser.hs index fc04595..215da73 100644 --- a/src/Data/GraphQL/Parser.hs +++ b/src/Language/GraphQL/Parser.hs @@ -1,13 +1,13 @@ {-# LANGUAGE LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} -module Data.GraphQL.Parser where +module Language.GraphQL.Parser where import Control.Applicative ( Alternative(..) , optional ) -import Data.GraphQL.AST -import Language.GraphQL.Lexer import Data.List.NonEmpty (NonEmpty(..)) +import Language.GraphQL.AST +import Language.GraphQL.Lexer import Text.Megaparsec ( lookAhead , option , try diff --git a/src/Data/GraphQL/Schema.hs b/src/Language/GraphQL/Schema.hs similarity index 98% rename from src/Data/GraphQL/Schema.hs rename to src/Language/GraphQL/Schema.hs index 56a9061..5569155 100644 --- a/src/Data/GraphQL/Schema.hs +++ b/src/Language/GraphQL/Schema.hs @@ -2,7 +2,7 @@ -- | This module provides a representation of a @GraphQL@ Schema in addition to -- functions for defining and manipulating Schemas. -module Data.GraphQL.Schema +module Language.GraphQL.Schema ( Resolver , Schema , Subs @@ -31,7 +31,6 @@ import Control.Monad.Trans.Except (runExceptT) import Data.Foldable ( find , fold ) -import Data.GraphQL.Error import Data.List.NonEmpty (NonEmpty) import Data.Maybe (fromMaybe) import qualified Data.Aeson as Aeson @@ -39,9 +38,10 @@ import Data.HashMap.Strict (HashMap) import qualified Data.HashMap.Strict as HashMap import Data.Text (Text) import qualified Data.Text as T +import Language.GraphQL.Error import Language.GraphQL.Trans import Language.GraphQL.Type -import Data.GraphQL.AST.Core +import Language.GraphQL.AST.Core -- | A GraphQL schema. -- @f@ is usually expected to be an instance of 'Alternative'. diff --git a/tests/Test/StarWars/QueryTests.hs b/tests/Test/StarWars/QueryTests.hs index 8dde8c2..27e66ea 100644 --- a/tests/Test/StarWars/QueryTests.hs +++ b/tests/Test/StarWars/QueryTests.hs @@ -7,14 +7,11 @@ import Data.Aeson ( object , (.=) ) import Data.Text (Text) +import Language.GraphQL +import Language.GraphQL.Schema (Subs) import Text.RawString.QQ (r) - import Test.Tasty (TestTree, testGroup) import Test.Tasty.HUnit (Assertion, testCase, (@?=)) - -import Data.GraphQL -import Data.GraphQL.Schema (Subs) - import Test.StarWars.Schema -- * Test diff --git a/tests/Test/StarWars/Schema.hs b/tests/Test/StarWars/Schema.hs index 13ec9fd..6615d09 100644 --- a/tests/Test/StarWars/Schema.hs +++ b/tests/Test/StarWars/Schema.hs @@ -6,12 +6,12 @@ import Control.Monad (MonadPlus(..)) import Control.Monad.Trans.Except (throwE) import Control.Monad.Trans.Class (lift) import Data.List.NonEmpty (NonEmpty((:|))) -import Data.GraphQL.Schema ( Schema - , Resolver - , Argument(..) - , Value(..) - ) -import qualified Data.GraphQL.Schema as Schema +import Language.GraphQL.Schema ( Schema + , Resolver + , Argument(..) + , Value(..) + ) +import qualified Language.GraphQL.Schema as Schema import Language.GraphQL.Trans import Language.GraphQL.Type import Test.StarWars.Data diff --git a/tests/tasty.hs b/tests/tasty.hs index 9009302..dd7e356 100644 --- a/tests/tasty.hs +++ b/tests/tasty.hs @@ -1,9 +1,9 @@ module Main where -import qualified Data.GraphQL.Encoder as Encoder -import qualified Language.GraphQL.LexerTest as LexerTest -import qualified Data.GraphQL.Parser as Parser import qualified Data.Text.IO as T.IO +import qualified Language.GraphQL.Encoder as Encoder +import qualified Language.GraphQL.LexerTest as LexerTest +import qualified Language.GraphQL.Parser as Parser import Text.Megaparsec ( errorBundlePretty , parse )