graphql-query-rewriter-rc
Advanced tools
Comparing version 0.0.12 to 0.0.13
@@ -990,6 +990,7 @@ import { Kind, parse, print, isValueNode, parseType } from 'graphql'; | ||
var _this = this; | ||
var matchesFn = options.matchesFn, rewriteQueryFn = options.rewriteQueryFn, rewriteResponseFn = options.rewriteResponseFn, _a = options.matchConditions, matchConditions = _a === void 0 ? [function () { return true; }] : _a, rewriterOpts = __rest(options, ["matchesFn", "rewriteQueryFn", "rewriteResponseFn", "matchConditions"]); | ||
var matchesFn = options.matchesFn, rewriteQueryFn = options.rewriteQueryFn, rewriteVariablesFn = options.rewriteVariablesFn, rewriteResponseFn = options.rewriteResponseFn, _a = options.matchConditions, matchConditions = _a === void 0 ? [function () { return true; }] : _a, rewriterOpts = __rest(options, ["matchesFn", "rewriteQueryFn", "rewriteVariablesFn", "rewriteResponseFn", "matchConditions"]); | ||
_this = _super.call(this, __assign({}, rewriterOpts, { matchConditions: matchConditions })) || this; | ||
_this.matchesFn = matchesFn || _super.prototype.matches; | ||
_this.rewriteQueryFn = rewriteQueryFn || _super.prototype.rewriteQuery; | ||
_this.rewriteVariablesFn = rewriteVariablesFn || _super.prototype.rewriteVariables; | ||
_this.rewriteResponseFn = rewriteResponseFn || _super.prototype.rewriteResponse; | ||
@@ -1007,2 +1008,5 @@ return _this; | ||
}; | ||
CustomRewriter.prototype.rewriteVariables = function (nodeAndVarDefs, variables) { | ||
return this.rewriteVariablesFn(nodeAndVarDefs, variables); | ||
}; | ||
return CustomRewriter; | ||
@@ -1009,0 +1013,0 @@ }(Rewriter)); |
@@ -994,6 +994,7 @@ (function (global, factory) { | ||
var _this = this; | ||
var matchesFn = options.matchesFn, rewriteQueryFn = options.rewriteQueryFn, rewriteResponseFn = options.rewriteResponseFn, _a = options.matchConditions, matchConditions = _a === void 0 ? [function () { return true; }] : _a, rewriterOpts = __rest(options, ["matchesFn", "rewriteQueryFn", "rewriteResponseFn", "matchConditions"]); | ||
var matchesFn = options.matchesFn, rewriteQueryFn = options.rewriteQueryFn, rewriteVariablesFn = options.rewriteVariablesFn, rewriteResponseFn = options.rewriteResponseFn, _a = options.matchConditions, matchConditions = _a === void 0 ? [function () { return true; }] : _a, rewriterOpts = __rest(options, ["matchesFn", "rewriteQueryFn", "rewriteVariablesFn", "rewriteResponseFn", "matchConditions"]); | ||
_this = _super.call(this, __assign({}, rewriterOpts, { matchConditions: matchConditions })) || this; | ||
_this.matchesFn = matchesFn || _super.prototype.matches; | ||
_this.rewriteQueryFn = rewriteQueryFn || _super.prototype.rewriteQuery; | ||
_this.rewriteVariablesFn = rewriteVariablesFn || _super.prototype.rewriteVariables; | ||
_this.rewriteResponseFn = rewriteResponseFn || _super.prototype.rewriteResponse; | ||
@@ -1011,2 +1012,5 @@ return _this; | ||
}; | ||
CustomRewriter.prototype.rewriteVariables = function (nodeAndVarDefs, variables) { | ||
return this.rewriteVariablesFn(nodeAndVarDefs, variables); | ||
}; | ||
return CustomRewriter; | ||
@@ -1013,0 +1017,0 @@ }(Rewriter)); |
@@ -45,6 +45,7 @@ "use strict"; | ||
var _this = this; | ||
var matchesFn = options.matchesFn, rewriteQueryFn = options.rewriteQueryFn, rewriteResponseFn = options.rewriteResponseFn, _a = options.matchConditions, matchConditions = _a === void 0 ? [function () { return true; }] : _a, rewriterOpts = __rest(options, ["matchesFn", "rewriteQueryFn", "rewriteResponseFn", "matchConditions"]); | ||
var matchesFn = options.matchesFn, rewriteQueryFn = options.rewriteQueryFn, rewriteVariablesFn = options.rewriteVariablesFn, rewriteResponseFn = options.rewriteResponseFn, _a = options.matchConditions, matchConditions = _a === void 0 ? [function () { return true; }] : _a, rewriterOpts = __rest(options, ["matchesFn", "rewriteQueryFn", "rewriteVariablesFn", "rewriteResponseFn", "matchConditions"]); | ||
_this = _super.call(this, __assign({}, rewriterOpts, { matchConditions: matchConditions })) || this; | ||
_this.matchesFn = matchesFn || _super.prototype.matches; | ||
_this.rewriteQueryFn = rewriteQueryFn || _super.prototype.rewriteQuery; | ||
_this.rewriteVariablesFn = rewriteVariablesFn || _super.prototype.rewriteVariables; | ||
_this.rewriteResponseFn = rewriteResponseFn || _super.prototype.rewriteResponse; | ||
@@ -62,2 +63,5 @@ return _this; | ||
}; | ||
CustomRewriter.prototype.rewriteVariables = function (nodeAndVarDefs, variables) { | ||
return this.rewriteVariablesFn(nodeAndVarDefs, variables); | ||
}; | ||
return CustomRewriter; | ||
@@ -64,0 +68,0 @@ }(Rewriter_1.default)); |
@@ -7,2 +7,3 @@ import { ASTNode } from 'graphql'; | ||
rewriteQueryFn?: (nodeAndVarDefs: NodeAndVarDefs, variables: Variables) => NodeAndVarDefs; | ||
rewriteVariablesFn?: (nodeAndVarDefs: NodeAndVarDefs, variables: Variables) => Variables; | ||
rewriteResponseFn?: (response: any, key: string, index?: number, nodeMatchAndParents?: ASTNode[]) => NodeAndVarDefs; | ||
@@ -17,2 +18,3 @@ } | ||
protected rewriteQueryFn: (nodeAndVarDefs: NodeAndVarDefs, variables: Variables) => NodeAndVarDefs; | ||
protected rewriteVariablesFn: (nodeAndVarDefs: NodeAndVarDefs, variables: Variables) => Variables; | ||
protected rewriteResponseFn: (response: any, key: string, index?: number, nodeMatchAndParents?: ASTNode[]) => NodeAndVarDefs; | ||
@@ -23,3 +25,4 @@ constructor(options: CustomRewriterOpts); | ||
rewriteResponse(response: any, key: string, index?: number, nodeMatchAndParents?: ASTNode[]): NodeAndVarDefs; | ||
rewriteVariables(nodeAndVarDefs: NodeAndVarDefs, variables: Variables): Variables; | ||
} | ||
export default CustomRewriter; |
{ | ||
"name": "graphql-query-rewriter-rc", | ||
"version": "0.0.12", | ||
"version": "0.0.13", | ||
"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
392106
3858