Skip to content

Commit

Permalink
Correct the merge/commit handling to generate correct jquery queries. (
Browse files Browse the repository at this point in the history
  • Loading branch information
urkle committed Dec 16, 2021
1 parent 4d3c2eb commit bc5947b
Show file tree
Hide file tree
Showing 6 changed files with 2,754 additions and 98 deletions.
7 changes: 0 additions & 7 deletions Makefile

This file was deleted.

5 changes: 4 additions & 1 deletion graphql.js
Expand Up @@ -398,9 +398,12 @@
mergedVariables[method][variable] = merge.variables[matchingKey]
return '$' + variable.split('!')[0]
})
// remove the wrapping {}
query = query.replace(/^\{|\}\s*$/g, '').trim()

var alias = query.trim().match(/^[^\(]+\:/)
if (!alias) {
alias = query.replace(/^\{|\}$/gm, '').trim().match(/^[^\(\{]+/)[0] + ':'
alias = query.match(/^[^\(\{]+/)[0] + ':'
} else {
query = query.replace(/^[^\(]+\:/, '')
}
Expand Down
2 changes: 1 addition & 1 deletion graphql.min.js

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions package.json
Expand Up @@ -12,13 +12,18 @@
"graphql.min.js"
],
"scripts": {
"test": "make test",
"build": "make build"
"test": "jest --coverage",
"build": "uglifyjs graphql.js -o graphql.min.js"
},
"repository": {
"type": "git",
"url": "git+https://github.com/f/graphql-client.git"
},
"devDependencies": {
"jest": "^27.4.5",
"jest-mock-random": "^1.1.1",
"uglify-js": "^3.14.5"
},
"keywords": [
"graphql",
"graphql-client",
Expand Down

0 comments on commit bc5947b

Please sign in to comment.