Change the main namespace to Language.GraphQL

This commit is contained in:
Eugen Wissner 2019-07-07 06:31:53 +02:00
parent 1431db7e63
commit 22d4a4e583
14 changed files with 58 additions and 68 deletions

View File

@ -4,15 +4,15 @@ cabal-version: 1.12
-- --
-- see: https://github.com/sol/hpack -- see: https://github.com/sol/hpack
-- --
-- hash: 3b6e8e64a62fa7a1ef602db8cb6aec07bfb21e81af7c91c939bfa03833879a81 -- hash: 20a76d38355648944315f3aa937e5cd72837bbd1b93037f53e2849906de3f2c0
name: graphql name: graphql
version: 0.4.0.0 version: 0.4.0.0
synopsis: Haskell GraphQL implementation synopsis: Haskell GraphQL implementation
description: This package provides a rudimentary parser for the <https://facebook.github.io/graphql/ GraphQL> language. description: This package provides a rudimentary parser for the <https://graphql.github.io/graphql-spec/June2018/ GraphQL> language.
category: Web category: Language
homepage: https://github.com/jdnavarro/graphql-haskell 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 <j@dannynavarro.net>, author: Danny Navarro <j@dannynavarro.net>,
Matthías Páll Gissurarson <mpg@mpg.is>, Matthías Páll Gissurarson <mpg@mpg.is>,
Sólrún Halla Einarsdóttir <she@mpg.is> Sólrún Halla Einarsdóttir <she@mpg.is>
@ -34,20 +34,20 @@ data-files:
source-repository head source-repository head
type: git type: git
location: https://github.com/jdnavarro/graphql-haskell location: https://github.com/caraus-ecms/graphql
library library
exposed-modules: exposed-modules:
Data.GraphQL Language.GraphQL
Data.GraphQL.AST Language.GraphQL.AST
Data.GraphQL.AST.Core Language.GraphQL.AST.Core
Data.GraphQL.AST.Transform Language.GraphQL.AST.Transform
Data.GraphQL.Encoder Language.GraphQL.Encoder
Data.GraphQL.Error Language.GraphQL.Error
Data.GraphQL.Execute Language.GraphQL.Execute
Data.GraphQL.Parser
Data.GraphQL.Schema
Language.GraphQL.Lexer Language.GraphQL.Lexer
Language.GraphQL.Parser
Language.GraphQL.Schema
Language.GraphQL.Trans Language.GraphQL.Trans
Language.GraphQL.Type Language.GraphQL.Type
other-modules: other-modules:
@ -58,7 +58,6 @@ library
aeson aeson
, base >=4.7 && <5 , base >=4.7 && <5
, megaparsec , megaparsec
, scientific
, text , text
, transformers , transformers
, unordered-containers , unordered-containers
@ -86,5 +85,4 @@ test-suite tasty
, tasty-hunit , tasty-hunit
, text , text
, transformers , transformers
, unordered-containers
default-language: Haskell2010 default-language: Haskell2010

View File

@ -3,14 +3,14 @@ version: 0.4.0.0
synopsis: Haskell GraphQL implementation synopsis: Haskell GraphQL implementation
description: description:
This package provides a rudimentary parser for the This package provides a rudimentary parser for the
<https://facebook.github.io/graphql/ GraphQL> language. <https://graphql.github.io/graphql-spec/June2018/ GraphQL> language.
homepage: https://github.com/jdnavarro/graphql-haskell homepage: https://github.com/jdnavarro/graphql-haskell
maintainer: belka@caraus.de maintainer: belka@caraus.de
copyright:
- 2019 Eugen Wissner
- 2015-2017 J. Daniel Navarro
category: Web
github: caraus-ecms/graphql github: caraus-ecms/graphql
category: Language
copyright:
- (c) 2019 Eugen Wissner
- (c) 2015-2017 J. Daniel Navarro
author: author:
- Danny Navarro <j@dannynavarro.net> - Danny Navarro <j@dannynavarro.net>
- Matthías Páll Gissurarson <mpg@mpg.is> - Matthías Páll Gissurarson <mpg@mpg.is>
@ -33,12 +33,11 @@ dependencies:
- megaparsec - megaparsec
- text - text
- transformers - transformers
- unordered-containers
library: library:
source-dirs: src source-dirs: src
dependencies: dependencies:
- scientific - unordered-containers
tests: tests:
tasty: tasty:

View File

@ -1,5 +1,5 @@
-- | This module provides the functions to parse and execute @GraphQL@ queries. -- | This module provides the functions to parse and execute @GraphQL@ queries.
module Data.GraphQL where module Language.GraphQL where
import Control.Monad (MonadPlus) import Control.Monad (MonadPlus)
@ -10,11 +10,11 @@ import Text.Megaparsec ( errorBundlePretty
, parse , parse
) )
import Data.GraphQL.Execute import Language.GraphQL.Execute
import Data.GraphQL.Parser import Language.GraphQL.Parser
import Data.GraphQL.Schema import Language.GraphQL.Schema
import Data.GraphQL.Error import Language.GraphQL.Error
-- | Takes a 'Schema' and text representing a @GraphQL@ request document. -- | Takes a 'Schema' and text representing a @GraphQL@ request document.
-- If the text parses correctly as a @GraphQL@ query the query is -- If the text parses correctly as a @GraphQL@ query the query is

View File

@ -3,7 +3,7 @@
-- --
-- Target AST for Parser. -- Target AST for Parser.
module Data.GraphQL.AST where module Language.GraphQL.AST where
import Data.Int (Int32) import Data.Int (Int32)
import Data.List.NonEmpty (NonEmpty) import Data.List.NonEmpty (NonEmpty)

View File

@ -1,5 +1,5 @@
-- | This is the AST meant to be executed. -- | 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.Int (Int32)
import Data.List.NonEmpty (NonEmpty) import Data.List.NonEmpty (NonEmpty)

View File

@ -1,5 +1,5 @@
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE OverloadedStrings #-}
module Data.GraphQL.AST.Transform where module Language.GraphQL.AST.Transform where
import Control.Applicative (empty) import Control.Applicative (empty)
import Control.Monad ((<=<)) import Control.Monad ((<=<))
@ -8,12 +8,10 @@ import Data.Either (partitionEithers)
import Data.Foldable (fold, foldMap) import Data.Foldable (fold, foldMap)
import qualified Data.List.NonEmpty as NonEmpty import qualified Data.List.NonEmpty as NonEmpty
import Data.Monoid (Alt(Alt,getAlt), (<>)) import Data.Monoid (Alt(Alt,getAlt), (<>))
import Data.Text (Text) import Data.Text (Text)
import qualified Language.GraphQL.AST as Full
import qualified Data.GraphQL.AST as Full import qualified Language.GraphQL.AST.Core as Core
import qualified Data.GraphQL.AST.Core as Core import qualified Language.GraphQL.Schema as Schema
import qualified Data.GraphQL.Schema as Schema
type Name = Text type Name = Text

View File

@ -1,14 +1,12 @@
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE OverloadedStrings #-}
-- | This module defines a printer for the @GraphQL@ language. -- | 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.Foldable (fold)
import Data.Monoid ((<>)) import Data.Monoid ((<>))
import qualified Data.List.NonEmpty as NonEmpty (toList) import qualified Data.List.NonEmpty as NonEmpty (toList)
import Data.Text (Text, cons, intercalate, pack, snoc) import Data.Text (Text, cons, intercalate, pack, snoc)
import Language.GraphQL.AST
import Data.GraphQL.AST
-- * Document -- * Document

View File

@ -1,5 +1,5 @@
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE OverloadedStrings #-}
module Data.GraphQL.Error module Language.GraphQL.Error
( parseError ( parseError
, CollectErrsT , CollectErrsT
, addErr , addErr

View File

@ -1,18 +1,18 @@
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE OverloadedStrings #-}
-- | This module provides the function to execute a @GraphQL@ request -- -- | This module provides the function to execute a @GraphQL@ request --
-- according to a 'Schema'. -- according to a 'Schema'.
module Data.GraphQL.Execute (execute) where module Language.GraphQL.Execute (execute) where
import Control.Monad (MonadPlus(..)) import Control.Monad (MonadPlus(..))
import Data.GraphQL.Error
import qualified Data.List.NonEmpty as NE import qualified Data.List.NonEmpty as NE
import Data.List.NonEmpty (NonEmpty((:|))) import Data.List.NonEmpty (NonEmpty((:|)))
import qualified Data.Aeson as Aeson import qualified Data.Aeson as Aeson
import qualified Data.GraphQL.AST as AST import qualified Language.GraphQL.AST as AST
import qualified Data.GraphQL.AST.Core as AST.Core import qualified Language.GraphQL.AST.Core as AST.Core
import qualified Data.GraphQL.AST.Transform as Transform import qualified Language.GraphQL.AST.Transform as Transform
import Data.GraphQL.Schema (Schema) import Language.GraphQL.Error
import qualified Data.GraphQL.Schema as Schema import Language.GraphQL.Schema (Schema)
import qualified Language.GraphQL.Schema as Schema
-- | Takes a 'Schema', a variable substitution function ('Schema.Subs'), and a -- | Takes a 'Schema', a variable substitution function ('Schema.Subs'), and a
-- @GraphQL@ 'document'. The substitution is applied to the document using -- @GraphQL@ 'document'. The substitution is applied to the document using

View File

@ -1,13 +1,13 @@
{-# LANGUAGE LambdaCase #-} {-# LANGUAGE LambdaCase #-}
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE OverloadedStrings #-}
module Data.GraphQL.Parser where module Language.GraphQL.Parser where
import Control.Applicative ( Alternative(..) import Control.Applicative ( Alternative(..)
, optional , optional
) )
import Data.GraphQL.AST
import Language.GraphQL.Lexer
import Data.List.NonEmpty (NonEmpty(..)) import Data.List.NonEmpty (NonEmpty(..))
import Language.GraphQL.AST
import Language.GraphQL.Lexer
import Text.Megaparsec ( lookAhead import Text.Megaparsec ( lookAhead
, option , option
, try , try

View File

@ -2,7 +2,7 @@
-- | This module provides a representation of a @GraphQL@ Schema in addition to -- | This module provides a representation of a @GraphQL@ Schema in addition to
-- functions for defining and manipulating Schemas. -- functions for defining and manipulating Schemas.
module Data.GraphQL.Schema module Language.GraphQL.Schema
( Resolver ( Resolver
, Schema , Schema
, Subs , Subs
@ -31,7 +31,6 @@ import Control.Monad.Trans.Except (runExceptT)
import Data.Foldable ( find import Data.Foldable ( find
, fold , fold
) )
import Data.GraphQL.Error
import Data.List.NonEmpty (NonEmpty) import Data.List.NonEmpty (NonEmpty)
import Data.Maybe (fromMaybe) import Data.Maybe (fromMaybe)
import qualified Data.Aeson as Aeson import qualified Data.Aeson as Aeson
@ -39,9 +38,10 @@ import Data.HashMap.Strict (HashMap)
import qualified Data.HashMap.Strict as HashMap import qualified Data.HashMap.Strict as HashMap
import Data.Text (Text) import Data.Text (Text)
import qualified Data.Text as T import qualified Data.Text as T
import Language.GraphQL.Error
import Language.GraphQL.Trans import Language.GraphQL.Trans
import Language.GraphQL.Type import Language.GraphQL.Type
import Data.GraphQL.AST.Core import Language.GraphQL.AST.Core
-- | A GraphQL schema. -- | A GraphQL schema.
-- @f@ is usually expected to be an instance of 'Alternative'. -- @f@ is usually expected to be an instance of 'Alternative'.

View File

@ -7,14 +7,11 @@ import Data.Aeson ( object
, (.=) , (.=)
) )
import Data.Text (Text) import Data.Text (Text)
import Language.GraphQL
import Language.GraphQL.Schema (Subs)
import Text.RawString.QQ (r) import Text.RawString.QQ (r)
import Test.Tasty (TestTree, testGroup) import Test.Tasty (TestTree, testGroup)
import Test.Tasty.HUnit (Assertion, testCase, (@?=)) import Test.Tasty.HUnit (Assertion, testCase, (@?=))
import Data.GraphQL
import Data.GraphQL.Schema (Subs)
import Test.StarWars.Schema import Test.StarWars.Schema
-- * Test -- * Test

View File

@ -6,12 +6,12 @@ import Control.Monad (MonadPlus(..))
import Control.Monad.Trans.Except (throwE) import Control.Monad.Trans.Except (throwE)
import Control.Monad.Trans.Class (lift) import Control.Monad.Trans.Class (lift)
import Data.List.NonEmpty (NonEmpty((:|))) import Data.List.NonEmpty (NonEmpty((:|)))
import Data.GraphQL.Schema ( Schema import Language.GraphQL.Schema ( Schema
, Resolver , Resolver
, Argument(..) , Argument(..)
, Value(..) , Value(..)
) )
import qualified Data.GraphQL.Schema as Schema import qualified Language.GraphQL.Schema as Schema
import Language.GraphQL.Trans import Language.GraphQL.Trans
import Language.GraphQL.Type import Language.GraphQL.Type
import Test.StarWars.Data import Test.StarWars.Data

View File

@ -1,9 +1,9 @@
module Main where 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 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 import Text.Megaparsec ( errorBundlePretty
, parse , parse
) )