zudoku 0.23.6 → 0.23.8

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-DStSNvP-.js";
3
+ import { o as a } from "./index-Bfm--TJU.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.6",
3
+ "version": "0.23.8",
4
4
  "type": "module",
5
5
  "homepage": "https://zudoku.dev",
6
6
  "repository": {
@@ -30,10 +30,6 @@ export const OpenApiRoute = ({
30
30
 
31
31
  const currentVersion = version ?? versions.at(0);
32
32
 
33
- if (!currentVersion) {
34
- throw new Error("No version found");
35
- }
36
-
37
33
  return (
38
34
  <OasConfigProvider
39
35
  value={{
@@ -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),
@@ -1,5 +1,5 @@
1
1
  import { createContext, useContext } from "react";
2
- import { OasPluginContext } from "./interfaces.js";
2
+ import { type OasPluginContext } from "./interfaces.js";
3
3
 
4
4
  const OasContext = createContext<{ config: OasPluginContext } | undefined>(
5
5
  undefined,
@@ -26,6 +26,6 @@ export type OasPluginContext = {
26
26
  server?: string;
27
27
  navigationId?: string;
28
28
  skipPreload?: boolean;
29
- version: string;
29
+ version?: string;
30
30
  versions: Record<string, string>;
31
31
  } & ContextOasSource;