forked from OSS/graphql
Change the main namespace to Language.GraphQL
This commit is contained in:
parent
1431db7e63
commit
22d4a4e583
@ -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 <https://facebook.github.io/graphql/ GraphQL> language.
|
||||
category: Web
|
||||
description: This package provides a rudimentary parser for the <https://graphql.github.io/graphql-spec/June2018/ GraphQL> 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 <j@dannynavarro.net>,
|
||||
Matthías Páll Gissurarson <mpg@mpg.is>,
|
||||
Sólrún Halla Einarsdóttir <she@mpg.is>
|
||||
@ -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
|
||||
|
13
package.yaml
13
package.yaml
@ -3,14 +3,14 @@ version: 0.4.0.0
|
||||
synopsis: Haskell GraphQL implementation
|
||||
description:
|
||||
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
|
||||
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 <j@dannynavarro.net>
|
||||
- Matthías Páll Gissurarson <mpg@mpg.is>
|
||||
@ -33,12 +33,11 @@ dependencies:
|
||||
- megaparsec
|
||||
- text
|
||||
- transformers
|
||||
- unordered-containers
|
||||
|
||||
library:
|
||||
source-dirs: src
|
||||
dependencies:
|
||||
- scientific
|
||||
- unordered-containers
|
||||
|
||||
tests:
|
||||
tasty:
|
||||
|
@ -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
|
@ -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)
|
@ -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)
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -1,5 +1,5 @@
|
||||
{-# LANGUAGE OverloadedStrings #-}
|
||||
module Data.GraphQL.Error
|
||||
module Language.GraphQL.Error
|
||||
( parseError
|
||||
, CollectErrsT
|
||||
, addErr
|
@ -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
|
@ -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
|
@ -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'.
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user