forked from OSS/graphql
parent
3497784984
commit
def52ddc20
@ -1,6 +1,12 @@
|
||||
# Change Log
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
## Unreleased
|
||||
### Fixed
|
||||
- Parsing multiple string arguments, such as
|
||||
`login(username: "username", password: "password")` would fail on the comma
|
||||
due to strings not having a space consumer.
|
||||
|
||||
## [0.6.0.0] - 2019-11-27
|
||||
### Changed
|
||||
- `Language.GraphQL.Encoder` moved to `Language.GraphQL.AST.Encoder`.
|
||||
|
@ -134,7 +134,7 @@ braces = between (symbol "{") (symbol "}")
|
||||
|
||||
-- | Parser for strings.
|
||||
string :: Parser T.Text
|
||||
string = between "\"" "\"" stringValue
|
||||
string = between "\"" "\"" stringValue <* spaceConsumer
|
||||
where
|
||||
stringValue = T.pack <$> many stringCharacter
|
||||
stringCharacter = satisfy isStringCharacter1
|
||||
@ -143,7 +143,7 @@ string = between "\"" "\"" stringValue
|
||||
|
||||
-- | Parser for block strings.
|
||||
blockString :: Parser T.Text
|
||||
blockString = between "\"\"\"" "\"\"\"" stringValue
|
||||
blockString = between "\"\"\"" "\"\"\"" stringValue <* spaceConsumer
|
||||
where
|
||||
stringValue = do
|
||||
byLine <- sepBy (many blockStringCharacter) lineTerminator
|
||||
|
@ -30,3 +30,15 @@ spec = describe "Parser" $ do
|
||||
mutation auth($username: String!, $password: String!){
|
||||
test
|
||||
}|]
|
||||
|
||||
it "accepts two string arguments" $
|
||||
parse document "" `shouldSucceedOn` [r|
|
||||
mutation auth{
|
||||
test(username: "username", password: "password")
|
||||
}|]
|
||||
|
||||
it "accepts two block string arguments" $
|
||||
parse document "" `shouldSucceedOn` [r|
|
||||
mutation auth{
|
||||
test(username: """username""", password: """password""")
|
||||
}|]
|
||||
|
Loading…
Reference in New Issue
Block a user