graphql-query-rewriter
Advanced tools
Comparing version 2.0.0 to 3.0.0
@@ -268,7 +268,5 @@ import { parse, print, parseType } from 'graphql'; | ||
}); | ||
return newResults; | ||
} | ||
else { | ||
newResults[curPathElm] = callback(results, curPathElm); | ||
} | ||
return newResults; | ||
return callback(results, curPathElm); | ||
} | ||
@@ -402,3 +400,3 @@ var remainingPath = path.slice(1); | ||
Rewriter.prototype.rewriteResponse = function (response, key) { | ||
return response[key]; | ||
return response; | ||
}; | ||
@@ -614,3 +612,4 @@ return Rewriter; | ||
NestFieldOutputsRewriter.prototype.rewriteResponse = function (response, key) { | ||
var pathResponse = _super.prototype.rewriteResponse.call(this, response, key); | ||
var _a; | ||
var pathResponse = response[key]; | ||
if (typeof pathResponse === 'object') { | ||
@@ -622,6 +621,6 @@ // undo the nesting in the response so it matches the original query | ||
delete rewrittenResponse[this.newOutputName]; | ||
return rewrittenResponse; | ||
return __assign({}, response, (_a = {}, _a[key] = rewrittenResponse, _a)); | ||
} | ||
} | ||
return pathResponse; | ||
return response; | ||
}; | ||
@@ -672,8 +671,9 @@ return NestFieldOutputsRewriter; | ||
ScalarFieldToObjectFieldRewriter.prototype.rewriteResponse = function (response, key) { | ||
var pathResponse = _super.prototype.rewriteResponse.call(this, response, key); | ||
var _a; | ||
if (typeof response === 'object') { | ||
var pathResponse = response[key]; | ||
// undo the nesting in the response so it matches the original query | ||
return pathResponse[this.objectFieldName]; | ||
return __assign({}, response, (_a = {}, _a[key] = pathResponse[this.objectFieldName], _a)); | ||
} | ||
return pathResponse; | ||
return response; | ||
}; | ||
@@ -680,0 +680,0 @@ return ScalarFieldToObjectFieldRewriter; |
@@ -272,7 +272,5 @@ (function (global, factory) { | ||
}); | ||
return newResults; | ||
} | ||
else { | ||
newResults[curPathElm] = callback(results, curPathElm); | ||
} | ||
return newResults; | ||
return callback(results, curPathElm); | ||
} | ||
@@ -406,3 +404,3 @@ var remainingPath = path.slice(1); | ||
Rewriter.prototype.rewriteResponse = function (response, key) { | ||
return response[key]; | ||
return response; | ||
}; | ||
@@ -618,3 +616,4 @@ return Rewriter; | ||
NestFieldOutputsRewriter.prototype.rewriteResponse = function (response, key) { | ||
var pathResponse = _super.prototype.rewriteResponse.call(this, response, key); | ||
var _a; | ||
var pathResponse = response[key]; | ||
if (typeof pathResponse === 'object') { | ||
@@ -626,6 +625,6 @@ // undo the nesting in the response so it matches the original query | ||
delete rewrittenResponse[this.newOutputName]; | ||
return rewrittenResponse; | ||
return __assign({}, response, (_a = {}, _a[key] = rewrittenResponse, _a)); | ||
} | ||
} | ||
return pathResponse; | ||
return response; | ||
}; | ||
@@ -676,8 +675,9 @@ return NestFieldOutputsRewriter; | ||
ScalarFieldToObjectFieldRewriter.prototype.rewriteResponse = function (response, key) { | ||
var pathResponse = _super.prototype.rewriteResponse.call(this, response, key); | ||
var _a; | ||
if (typeof response === 'object') { | ||
var pathResponse = response[key]; | ||
// undo the nesting in the response so it matches the original query | ||
return pathResponse[this.objectFieldName]; | ||
return __assign({}, response, (_a = {}, _a[key] = pathResponse[this.objectFieldName], _a)); | ||
} | ||
return pathResponse; | ||
return response; | ||
}; | ||
@@ -684,0 +684,0 @@ return ScalarFieldToObjectFieldRewriter; |
@@ -232,7 +232,5 @@ "use strict"; | ||
}); | ||
return newResults; | ||
} | ||
else { | ||
newResults[curPathElm] = callback(results, curPathElm); | ||
} | ||
return newResults; | ||
return callback(results, curPathElm); | ||
} | ||
@@ -239,0 +237,0 @@ var remainingPath = path.slice(1); |
@@ -78,3 +78,4 @@ "use strict"; | ||
NestFieldOutputsRewriter.prototype.rewriteResponse = function (response, key) { | ||
var pathResponse = _super.prototype.rewriteResponse.call(this, response, key); | ||
var _a; | ||
var pathResponse = response[key]; | ||
if (typeof pathResponse === 'object') { | ||
@@ -86,6 +87,6 @@ // undo the nesting in the response so it matches the original query | ||
delete rewrittenResponse[this.newOutputName]; | ||
return rewrittenResponse; | ||
return __assign({}, response, (_a = {}, _a[key] = rewrittenResponse, _a)); | ||
} | ||
} | ||
return pathResponse; | ||
return response; | ||
}; | ||
@@ -92,0 +93,0 @@ return NestFieldOutputsRewriter; |
@@ -41,3 +41,3 @@ "use strict"; | ||
Rewriter.prototype.rewriteResponse = function (response, key) { | ||
return response[key]; | ||
return response; | ||
}; | ||
@@ -44,0 +44,0 @@ return Rewriter; |
@@ -69,8 +69,9 @@ "use strict"; | ||
ScalarFieldToObjectFieldRewriter.prototype.rewriteResponse = function (response, key) { | ||
var pathResponse = _super.prototype.rewriteResponse.call(this, response, key); | ||
var _a; | ||
if (typeof response === 'object') { | ||
var pathResponse = response[key]; | ||
// undo the nesting in the response so it matches the original query | ||
return pathResponse[this.objectFieldName]; | ||
return __assign({}, response, (_a = {}, _a[key] = pathResponse[this.objectFieldName], _a)); | ||
} | ||
return pathResponse; | ||
return response; | ||
}; | ||
@@ -77,0 +78,0 @@ return ScalarFieldToObjectFieldRewriter; |
{ | ||
"name": "graphql-query-rewriter", | ||
"version": "2.0.0", | ||
"version": "3.0.0", | ||
"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
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
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
286977