Skip to content

Commit

Permalink
Bracket type parsing problem fixed (#52)
Browse files Browse the repository at this point in the history
* Bracket type parsing problem fixed

* Bracket variable test added
  • Loading branch information
SinanMtl authored and f committed Nov 27, 2019
1 parent a38ad15 commit 023dde9
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
6 changes: 5 additions & 1 deletion graphql.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,11 @@
var types = []
for (var key in variables) {
var value = variables[key]
var keyAndType = key.split("!")
var keyAndType = key.split(/^(.*?)\!/)
if (keyAndType.length > 1) {
keyAndType = keyAndType.slice(1)
keyAndType[1] = keyAndType[1].replace(/(.*?)\!$/, "$1")
}
var mapping = typeMap[typeof(value)]
var mappedType = typeof(mapping) === "function" ? mapping(value) : mapping
if (!key.match("!") && keyAndType[0].match(/_?id/i)) {
Expand Down
Loading

0 comments on commit 023dde9

Please sign in to comment.