@graphql-tools/wrap 7.0.6-alpha-1a132cb3.0 → 7.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es5/index.cjs.js +6 -6
- package/es5/index.cjs.js.map +1 -1
- package/es5/index.esm.js +6 -6
- package/es5/index.esm.js.map +1 -1
- package/es5/package.json +5 -5
- package/es5/transforms/TransformQuery.d.ts +4 -4
- package/index.cjs.js +6 -6
- package/index.cjs.js.map +1 -1
- package/index.esm.js +6 -6
- package/index.esm.js.map +1 -1
- package/package.json +5 -5
- package/transforms/TransformQuery.d.ts +4 -4
package/index.esm.js
CHANGED
|
@@ -886,7 +886,7 @@ class TransformQuery {
|
|
|
886
886
|
this.errorPathTransformer = errorPathTransformer;
|
|
887
887
|
this.fragments = fragments;
|
|
888
888
|
}
|
|
889
|
-
transformRequest(originalRequest,
|
|
889
|
+
transformRequest(originalRequest, delegationContext, transformationContext) {
|
|
890
890
|
const pathLength = this.path.length;
|
|
891
891
|
let index = 0;
|
|
892
892
|
const document = visit(originalRequest.document, {
|
|
@@ -897,7 +897,7 @@ class TransformQuery {
|
|
|
897
897
|
}
|
|
898
898
|
index++;
|
|
899
899
|
if (index === pathLength) {
|
|
900
|
-
const selectionSet = this.queryTransformer(node.selectionSet, this.fragments);
|
|
900
|
+
const selectionSet = this.queryTransformer(node.selectionSet, this.fragments, delegationContext, transformationContext);
|
|
901
901
|
return {
|
|
902
902
|
...node,
|
|
903
903
|
selectionSet,
|
|
@@ -914,15 +914,15 @@ class TransformQuery {
|
|
|
914
914
|
document,
|
|
915
915
|
};
|
|
916
916
|
}
|
|
917
|
-
transformResult(originalResult,
|
|
918
|
-
const data = this.transformData(originalResult.data);
|
|
917
|
+
transformResult(originalResult, delegationContext, transformationContext) {
|
|
918
|
+
const data = this.transformData(originalResult.data, delegationContext, transformationContext);
|
|
919
919
|
const errors = originalResult.errors;
|
|
920
920
|
return {
|
|
921
921
|
data,
|
|
922
922
|
errors: errors != null ? this.transformErrors(errors) : undefined,
|
|
923
923
|
};
|
|
924
924
|
}
|
|
925
|
-
transformData(data) {
|
|
925
|
+
transformData(data, delegationContext, transformationContext) {
|
|
926
926
|
const leafIndex = this.path.length - 1;
|
|
927
927
|
let index = 0;
|
|
928
928
|
let newData = data;
|
|
@@ -938,7 +938,7 @@ class TransformQuery {
|
|
|
938
938
|
index++;
|
|
939
939
|
next = this.path[index];
|
|
940
940
|
}
|
|
941
|
-
newData[next] = this.resultTransformer(newData[next]);
|
|
941
|
+
newData[next] = this.resultTransformer(newData[next], delegationContext, transformationContext);
|
|
942
942
|
}
|
|
943
943
|
return newData;
|
|
944
944
|
}
|