houdini-svelte 1.2.36 → 1.2.38

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.
@@ -105,7 +105,7 @@ class QueryStoreOffset extends import_query.QueryStore {
105
105
  this.#_handlers = (0, import_pagination.offsetHandlers)({
106
106
  artifact: this.artifact,
107
107
  storeName: this.name,
108
- fetch: super.fetch,
108
+ fetch: super.fetch.bind(this),
109
109
  getState: () => (0, import_store.get)(this.observer).data,
110
110
  getVariables: () => (0, import_store.get)(this.observer).variables,
111
111
  getSession: import_session.getSession,
@@ -103,10 +103,15 @@ This will result in duplicate queries. If you are trying to ensure there is alwa
103
103
  need_to_block = false;
104
104
  }
105
105
  const fakeAwait = import_adapter.clientStarted && import_adapter.isBrowser && !need_to_block;
106
- if (policy !== import_types.CachePolicy.NetworkOnly && fakeAwait) {
106
+ const usedVariables = {
107
+ ...this.artifact.input?.defaults,
108
+ ...params.variables
109
+ };
110
+ const refersToCache = policy !== import_types.CachePolicy.NetworkOnly && policy !== import_types.CachePolicy.NoCache;
111
+ if (refersToCache && fakeAwait) {
107
112
  await this.observer.send({
108
113
  fetch: context.fetch,
109
- variables: params.variables,
114
+ variables: usedVariables,
110
115
  metadata: params.metadata,
111
116
  session: context.session,
112
117
  policy: import_types.CachePolicy.CacheOnly,
@@ -115,7 +120,7 @@ This will result in duplicate queries. If you are trying to ensure there is alwa
115
120
  }
116
121
  const request = this.observer.send({
117
122
  fetch: context.fetch,
118
- variables: params.variables,
123
+ variables: usedVariables,
119
124
  metadata: params.metadata,
120
125
  session: context.session,
121
126
  policy,
@@ -81,7 +81,7 @@ class QueryStoreOffset extends QueryStore {
81
81
  this.#_handlers = offsetHandlers({
82
82
  artifact: this.artifact,
83
83
  storeName: this.name,
84
- fetch: super.fetch,
84
+ fetch: super.fetch.bind(this),
85
85
  getState: () => get(this.observer).data,
86
86
  getVariables: () => get(this.observer).variables,
87
87
  getSession,
@@ -73,10 +73,15 @@ This will result in duplicate queries. If you are trying to ensure there is alwa
73
73
  need_to_block = false;
74
74
  }
75
75
  const fakeAwait = clientStarted && isBrowser && !need_to_block;
76
- if (policy !== CachePolicy.NetworkOnly && fakeAwait) {
76
+ const usedVariables = {
77
+ ...this.artifact.input?.defaults,
78
+ ...params.variables
79
+ };
80
+ const refersToCache = policy !== CachePolicy.NetworkOnly && policy !== CachePolicy.NoCache;
81
+ if (refersToCache && fakeAwait) {
77
82
  await this.observer.send({
78
83
  fetch: context.fetch,
79
- variables: params.variables,
84
+ variables: usedVariables,
80
85
  metadata: params.metadata,
81
86
  session: context.session,
82
87
  policy: CachePolicy.CacheOnly,
@@ -85,7 +90,7 @@ This will result in duplicate queries. If you are trying to ensure there is alwa
85
90
  }
86
91
  const request = this.observer.send({
87
92
  fetch: context.fetch,
88
- variables: params.variables,
93
+ variables: usedVariables,
89
94
  metadata: params.metadata,
90
95
  session: context.session,
91
96
  policy,