@tanstack/react-query 4.17.1 → 4.18.0

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.
@@ -1913,6 +1913,12 @@
1913
1913
  return (_this$queryCache$find = this.queryCache.find(queryKey, filters)) == null ? void 0 : _this$queryCache$find.state.data;
1914
1914
  }
1915
1915
 
1916
+ ensureQueryData(arg1, arg2, arg3) {
1917
+ const parsedOptions = parseQueryArgs(arg1, arg2, arg3);
1918
+ const cachedData = this.getQueryData(parsedOptions.queryKey);
1919
+ return cachedData ? Promise.resolve(cachedData) : this.fetchQuery(parsedOptions);
1920
+ }
1921
+
1916
1922
  getQueriesData(queryKeyOrFilters) {
1917
1923
  return this.getQueryCache().findAll(queryKeyOrFilters).map(({
1918
1924
  queryKey,