This commit is contained in:
Eugen Wissner 2019-09-06 07:48:01 +02:00
parent 63d4de485d
commit 1704022e74
3 changed files with 17 additions and 2 deletions

View File

@ -16,6 +16,9 @@ All notable changes to this project will be documented in this file.
There are actually only two generic types in GraphQL: Scalars and objects. There are actually only two generic types in GraphQL: Scalars and objects.
Enum is a scalar value. Enum is a scalar value.
### Fixed
- Parsing block string values.
## [0.5.0.0] - 2019-08-14 ## [0.5.0.0] - 2019-08-14
### Added ### Added
- `executeWithName` executes an operation with the given name. - `executeWithName` executes an operation with the given name.

View File

@ -108,8 +108,8 @@ value = ValueVariable <$> variable
<|> ValueInt <$> integer <|> ValueInt <$> integer
<|> ValueBoolean <$> booleanValue <|> ValueBoolean <$> booleanValue
<|> ValueNull <$ symbol "null" <|> ValueNull <$ symbol "null"
<|> ValueString <$> string
<|> ValueString <$> blockString <|> ValueString <$> blockString
<|> ValueString <$> string
<|> ValueEnum <$> try enumValue <|> ValueEnum <$> try enumValue
<|> ValueList <$> listValue <|> ValueList <$> listValue
<|> ValueObject <$> objectValue <|> ValueObject <$> objectValue

View File

@ -1,4 +1,5 @@
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
module Language.GraphQL.ParserSpec module Language.GraphQL.ParserSpec
( spec ( spec
) where ) where
@ -11,8 +12,19 @@ import Test.Hspec ( Spec
, shouldSatisfy , shouldSatisfy
) )
import Text.Megaparsec (parse) import Text.Megaparsec (parse)
import Text.RawString.QQ (r)
spec :: Spec spec :: Spec
spec = describe "Parser" $ spec = describe "Parser" $ do
it "accepts BOM header" $ it "accepts BOM header" $
parse document "" "\xfeff{foo}" `shouldSatisfy` isRight parse document "" "\xfeff{foo}" `shouldSatisfy` isRight
it "accepts block strings as argument" $
parse document "" [r|{
hello(text: """Argument""")
}|] `shouldSatisfy` isRight
it "accepts strings as argument" $
parse document "" [r|{
hello(text: "Argument")
}|] `shouldSatisfy` isRight