graphql-parse-resolve-info
Advanced tools
Comparing version 4.0.0-beta.7.1 to 4.0.0-beta.7.2
@@ -58,14 +58,12 @@ "use strict"; | ||
const asts = resolveInfo.fieldNodes || resolveInfo.fieldASTs; | ||
const alias = asts.reduce(function (alias, val) { | ||
if (!alias) { | ||
if (val.kind === "Field") { | ||
alias = val.alias ? val.alias.value : val.name && val.name.value; | ||
for (let i = 0, l = asts.length; i < l; i++) { | ||
const val = asts[i]; | ||
if (val.kind === "Field") { | ||
const alias = val.alias ? val.alias.value : val.name && val.name.value; | ||
if (alias) { | ||
return alias; | ||
} | ||
} | ||
return alias; | ||
}, null); | ||
if (!alias) { | ||
throw new Error("Could not determine alias?!"); | ||
} | ||
return alias; | ||
throw new Error("Could not determine alias?!"); | ||
} | ||
@@ -72,0 +70,0 @@ |
{ | ||
"name": "graphql-parse-resolve-info", | ||
"version": "4.0.0-beta.7.1", | ||
"version": "4.0.0-beta.7.2", | ||
"description": "Parse GraphQLResolveInfo (the 4th argument of resolve) into a simple tree", | ||
@@ -5,0 +5,0 @@ "main": "node8plus/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
51340
215