eddev 2.0.0-beta.66 → 2.0.0-beta.68

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.
@@ -1,4 +1,4 @@
1
- import { useInfiniteQuery, useMutation, useQuery, } from "@tanstack/react-query";
1
+ import { useInfiniteQuery, useMutation, useQuery, useQueryClient, } from "@tanstack/react-query";
2
2
  import { useEffect, useState } from "react";
3
3
  import { joinURL } from "ufo";
4
4
  import { getQueryClient } from "../../utils/query-client.js";
@@ -15,6 +15,9 @@ class QueryError extends Error {
15
15
  this.messages = args.messages;
16
16
  }
17
17
  }
18
+ function useFallbackClient() {
19
+ return useQueryClient(getQueryClient());
20
+ }
18
21
  const fetchGETQuery = async (name, params, opts) => {
19
22
  let url;
20
23
  let options = {
@@ -58,7 +61,7 @@ export function createUseQuery(init) {
58
61
  headers: options?.headers,
59
62
  }),
60
63
  ...options,
61
- });
64
+ }, useFallbackClient());
62
65
  };
63
66
  hook.fetch = async (args, options) => {
64
67
  const customKey = apiConfig.customQueryKey;
@@ -187,7 +190,7 @@ export function createUseMutation(init) {
187
190
  headers: options?.headers,
188
191
  }),
189
192
  ...options,
190
- });
193
+ }, useFallbackClient());
191
194
  };
192
195
  hook.mutate = async (args, options) => {
193
196
  return fetchMutation(init.name, args, {
@@ -204,7 +207,7 @@ export function useRPCQuery(key, args, options) {
204
207
  return getRPCClient().query(key, args.queryKey[2]);
205
208
  },
206
209
  ...options,
207
- });
210
+ }, useFallbackClient());
208
211
  }
209
212
  export function useRPCMutation(key, options) {
210
213
  return useMutation({
@@ -213,5 +216,5 @@ export function useRPCMutation(key, options) {
213
216
  return getRPCClient().mutation(key, args);
214
217
  },
215
218
  ...options,
216
- });
219
+ }, useFallbackClient());
217
220
  }
@@ -6,7 +6,7 @@ type RouterEntry<T extends RouterTable, U extends AnyTRPCProcedure, P extends st
6
6
  input: inferProcedureInput<T[K]>;
7
7
  output: inferProcedureOutput<T[K]>;
8
8
  procedure: T[K] extends AnyTRPCProcedure ? T[K] : never;
9
- } : T[K] extends Record<string, U> ? RouterEntry<T[K], U, `${K}.`> : never : never;
9
+ } : T[K] extends Record<string, AnyTRPCProcedure> ? RouterEntry<T[K], U, `${K}.`> : never : never;
10
10
  }[keyof T];
11
11
  type RouterTypes<T extends RouterTable> = {
12
12
  queries: RouterEntry<T, AnyTRPCQueryProcedure>;
@@ -1 +1 @@
1
- export declare const VERSION = "2.0.0-beta.66";
1
+ export declare const VERSION = "2.0.0-beta.68";
@@ -1 +1 @@
1
- export const VERSION = "2.0.0-beta.66";
1
+ export const VERSION = "2.0.0-beta.68";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eddev",
3
- "version": "2.0.0-beta.66",
3
+ "version": "2.0.0-beta.68",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "type": "module",