zudoku 0.23.7 → 0.23.9

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,6 +1,6 @@
1
1
  import "./jsx-runtime-Dx-03ztt.js";
2
2
  import "./chunk-D52XG6IA-Dl7HLe6j.js";
3
- import { o as a } from "./index-D8Hk4b5L.js";
3
+ import { o as a } from "./index-DtJxZrbj.js";
4
4
  import "./utils-B4O1uet5.js";
5
5
  import "lucide-react";
6
6
  import "./hook-DgGeo5iL.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zudoku",
3
- "version": "0.23.7",
3
+ "version": "0.23.9",
4
4
  "type": "module",
5
5
  "homepage": "https://zudoku.dev",
6
6
  "repository": {
@@ -12,7 +12,19 @@ export const useCreateQuery = <TResult, TVariables>(
12
12
  throw new Error("useGraphQL must be used within a GraphQLProvider");
13
13
  }
14
14
 
15
- const hash = useMemo(() => hashit(variables[0] ?? {}), [variables]);
15
+ const hash = useMemo(() => {
16
+ if (
17
+ typeof variables[0] === "object" &&
18
+ variables[0] != null &&
19
+ "input" in variables[0] &&
20
+ typeof variables[0].input === "function"
21
+ ) {
22
+ // This is a pre-hashed name to ensure that the query key is consistent across server and client
23
+ return variables[0].input.name;
24
+ }
25
+
26
+ return hashit(variables[0] ?? {});
27
+ }, [variables]);
16
28
 
17
29
  return {
18
30
  queryFn: () => graphQLClient.fetch(query, ...variables),
@@ -166,9 +166,11 @@ export const openApiPlugin = (config: OpenApiPluginOptions): ZudokuPlugin => {
166
166
  return [];
167
167
  }
168
168
  },
169
- getRoutes: () => [
170
- {
171
- path: basePath + "/:version?",
169
+ getRoutes: () => {
170
+ const versionsInPath = [null, ...versions];
171
+
172
+ return versionsInPath.map((version) => ({
173
+ path: basePath + (version ? `/${version}` : ""),
172
174
  async lazy() {
173
175
  const { OpenApiRoute } = await import("./Route.js");
174
176
  return {
@@ -191,7 +193,7 @@ export const openApiPlugin = (config: OpenApiPluginOptions): ZudokuPlugin => {
191
193
  },
192
194
  },
193
195
  ],
194
- },
195
- ],
196
+ }));
197
+ },
196
198
  };
197
199
  };