graphql-query-rewriter-rc
Advanced tools
Comparing version 0.0.16 to 0.0.17
@@ -313,14 +313,13 @@ import { Kind, parse, print, isValueNode, parseType } from 'graphql'; | ||
var remainingPath = path.slice(1); | ||
if (curResults === undefined || curResults === null) { | ||
// If curResults is undefined or null, and includesNonFieldPaths, | ||
// its likely that curResults is undefined because curPathElm might not be a field path. | ||
if (remainingPath.length && includesNonFieldPaths) { | ||
// Call the callback in case the non-field paths is expected of a rewrite | ||
callback(results, curPathElm); | ||
// Then just continue with the next path | ||
return rewriteResultsAtPath(results, remainingPath, callback, includesNonFieldPaths); | ||
} | ||
// else, if the path stops here, just return results without any rewriting | ||
// If curResults is undefined, and includesNonFieldPaths is true, | ||
// then curResults is not a field path, so call the callback to allow rewrites | ||
// for non-field paths. | ||
if (remainingPath.length && includesNonFieldPaths && curResults === undefined) { | ||
callback(results, curPathElm); | ||
// Then just continue with the next path | ||
return rewriteResultsAtPath(results, remainingPath, callback, includesNonFieldPaths); | ||
} | ||
// if the path stops here, just return results without any rewriting | ||
if (curResults === undefined || curResults === null) | ||
return results; | ||
} | ||
if (Array.isArray(curResults)) { | ||
@@ -327,0 +326,0 @@ newResults[curPathElm] = curResults.map(function (result) { |
@@ -317,14 +317,13 @@ (function (global, factory) { | ||
var remainingPath = path.slice(1); | ||
if (curResults === undefined || curResults === null) { | ||
// If curResults is undefined or null, and includesNonFieldPaths, | ||
// its likely that curResults is undefined because curPathElm might not be a field path. | ||
if (remainingPath.length && includesNonFieldPaths) { | ||
// Call the callback in case the non-field paths is expected of a rewrite | ||
callback(results, curPathElm); | ||
// Then just continue with the next path | ||
return rewriteResultsAtPath(results, remainingPath, callback, includesNonFieldPaths); | ||
} | ||
// else, if the path stops here, just return results without any rewriting | ||
// If curResults is undefined, and includesNonFieldPaths is true, | ||
// then curResults is not a field path, so call the callback to allow rewrites | ||
// for non-field paths. | ||
if (remainingPath.length && includesNonFieldPaths && curResults === undefined) { | ||
callback(results, curPathElm); | ||
// Then just continue with the next path | ||
return rewriteResultsAtPath(results, remainingPath, callback, includesNonFieldPaths); | ||
} | ||
// if the path stops here, just return results without any rewriting | ||
if (curResults === undefined || curResults === null) | ||
return results; | ||
} | ||
if (Array.isArray(curResults)) { | ||
@@ -331,0 +330,0 @@ newResults[curPathElm] = curResults.map(function (result) { |
@@ -268,14 +268,13 @@ "use strict"; | ||
var remainingPath = path.slice(1); | ||
if (curResults === undefined || curResults === null) { | ||
// If curResults is undefined or null, and includesNonFieldPaths, | ||
// its likely that curResults is undefined because curPathElm might not be a field path. | ||
if (remainingPath.length && includesNonFieldPaths) { | ||
// Call the callback in case the non-field paths is expected of a rewrite | ||
callback(results, curPathElm); | ||
// Then just continue with the next path | ||
return exports.rewriteResultsAtPath(results, remainingPath, callback, includesNonFieldPaths); | ||
} | ||
// else, if the path stops here, just return results without any rewriting | ||
// If curResults is undefined, and includesNonFieldPaths is true, | ||
// then curResults is not a field path, so call the callback to allow rewrites | ||
// for non-field paths. | ||
if (remainingPath.length && includesNonFieldPaths && curResults === undefined) { | ||
callback(results, curPathElm); | ||
// Then just continue with the next path | ||
return exports.rewriteResultsAtPath(results, remainingPath, callback, includesNonFieldPaths); | ||
} | ||
// if the path stops here, just return results without any rewriting | ||
if (curResults === undefined || curResults === null) | ||
return results; | ||
} | ||
if (Array.isArray(curResults)) { | ||
@@ -282,0 +281,0 @@ newResults[curPathElm] = curResults.map(function (result) { |
{ | ||
"name": "graphql-query-rewriter-rc", | ||
"version": "0.0.16", | ||
"version": "0.0.17", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "keywords": [], |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
397908
3887