forked from OSS/graphql
Fix #12
This commit is contained in:
parent
63d4de485d
commit
1704022e74
@ -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.
|
||||
Enum is a scalar value.
|
||||
|
||||
### Fixed
|
||||
- Parsing block string values.
|
||||
|
||||
## [0.5.0.0] - 2019-08-14
|
||||
### Added
|
||||
- `executeWithName` executes an operation with the given name.
|
||||
|
@ -108,8 +108,8 @@ value = ValueVariable <$> variable
|
||||
<|> ValueInt <$> integer
|
||||
<|> ValueBoolean <$> booleanValue
|
||||
<|> ValueNull <$ symbol "null"
|
||||
<|> ValueString <$> string
|
||||
<|> ValueString <$> blockString
|
||||
<|> ValueString <$> string
|
||||
<|> ValueEnum <$> try enumValue
|
||||
<|> ValueList <$> listValue
|
||||
<|> ValueObject <$> objectValue
|
||||
|
@ -1,4 +1,5 @@
|
||||
{-# LANGUAGE OverloadedStrings #-}
|
||||
{-# LANGUAGE QuasiQuotes #-}
|
||||
module Language.GraphQL.ParserSpec
|
||||
( spec
|
||||
) where
|
||||
@ -11,8 +12,19 @@ import Test.Hspec ( Spec
|
||||
, shouldSatisfy
|
||||
)
|
||||
import Text.Megaparsec (parse)
|
||||
import Text.RawString.QQ (r)
|
||||
|
||||
spec :: Spec
|
||||
spec = describe "Parser" $
|
||||
spec = describe "Parser" $ do
|
||||
it "accepts BOM header" $
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user