@envelop/response-cache 5.0.0 → 5.0.1-alpha-20230614122817-14924772

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/cjs/plugin.js CHANGED
@@ -79,7 +79,7 @@ function useResponseCache({ cache = (0, in_memory_cache_js_1.createInMemoryCache
79
79
  return {
80
80
  onParse() {
81
81
  return ({ result, replaceParseResult }) => {
82
- if (result.kind === graphql_1.Kind.DOCUMENT) {
82
+ if (!originalDocumentMap.has(result) && result.kind === graphql_1.Kind.DOCUMENT) {
83
83
  const newDocument = addTypeNameToDocument(result);
84
84
  replaceParseResult(newDocument);
85
85
  }
package/esm/plugin.js CHANGED
@@ -72,7 +72,7 @@ export function useResponseCache({ cache = createInMemoryCache(), ttl: globalTtl
72
72
  return {
73
73
  onParse() {
74
74
  return ({ result, replaceParseResult }) => {
75
- if (result.kind === Kind.DOCUMENT) {
75
+ if (!originalDocumentMap.has(result) && result.kind === Kind.DOCUMENT) {
76
76
  const newDocument = addTypeNameToDocument(result);
77
77
  replaceParseResult(newDocument);
78
78
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@envelop/response-cache",
3
- "version": "5.0.0",
3
+ "version": "5.0.1-alpha-20230614122817-14924772",
4
4
  "sideEffects": false,
5
5
  "peerDependencies": {
6
6
  "@envelop/core": "^4.0.0",