Skip to content

Commit be2b7aa

Browse files
SinanMtlf
authored andcommitted
Recursive fragment control problem fixed (#42)
1 parent 28c6347 commit be2b7aa

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

graphql.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@
205205
var path = fragment.replace(fragmentRegexp, function (_, $m) {return $m})
206206
var fragment = that.fragmentPath(fragments, path)
207207
if (fragment) {
208-
var pathRegexp = new RegExp(fragmentRegexp.source.replace(/\((.*)\)/, path))
208+
var pathRegexp = new RegExp(fragmentRegexp.source.replace(/\((.*)\)/, path) + '$')
209209
if (fragment.match(pathRegexp)) {
210210
throw new Error("Recursive fragment usage detected on " + path + ".")
211211
}

0 commit comments

Comments
 (0)