Skip to content

Commit

Permalink
#60 Fix escaped quotes parsing bug
Browse files Browse the repository at this point in the history
  • Loading branch information
chkimes committed Nov 11, 2016
1 parent 981a6ed commit 0a652b9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
16 changes: 16 additions & 0 deletions GraphQL.Parser.Test/ParserTest.fs
Expand Up @@ -112,6 +112,22 @@ mutation {
name
profilePic(width: 100, height: 50)
}
}"
[<Test>]
member __.TestStringArguments() =
good @"
{
user(id: ""abc"") {
id
}
}"
[<Test>]
member __.TestEscapedStringArguments() =
good @"
{
user(id: ""'a\""b\""c'"") {
id
}
}"
[<Test>]
member __.TestFieldAlias() =
Expand Down
2 changes: 1 addition & 1 deletion GraphQL.Parser/Parsing/Parser.fs
Expand Up @@ -178,7 +178,7 @@ to parse this type of sequence efficiently.
let stringValue =
let isRegularCharacter c =
c <> '"'
&& c <> '\''
&& c <> '\\'
&& c <> '\n'
let regularCharacters = manySatisfy isRegularCharacter
let escapedCharacter =
Expand Down

0 comments on commit 0a652b9

Please sign in to comment.