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.
- package/dist/lib/plugins/openapi/client/useCreateQuery.js +10 -1
- package/dist/lib/plugins/openapi/client/useCreateQuery.js.map +1 -1
- package/dist/lib/plugins/openapi/index.js +6 -5
- package/dist/lib/plugins/openapi/index.js.map +1 -1
- package/dist/vite/plugin-api.js +5 -1
- package/dist/vite/plugin-api.js.map +1 -1
- package/dist/vite/plugin-theme-css.js +53 -1
- package/dist/vite/plugin-theme-css.js.map +1 -1
- package/lib/{OperationList-oYa2YId2.js → OperationList-ChQR0IcQ.js} +3 -3
- package/lib/OperationList-ChQR0IcQ.js.map +1 -0
- package/lib/{index-D8Hk4b5L.js → index-DtJxZrbj.js} +124 -126
- package/lib/{index-D8Hk4b5L.js.map → index-DtJxZrbj.js.map} +1 -1
- package/lib/zudoku.plugin-openapi.js +1 -1
- package/package.json +1 -1
- package/src/lib/plugins/openapi/client/useCreateQuery.ts +13 -1
- package/src/lib/plugins/openapi/index.tsx +7 -5
- package/lib/OperationList-oYa2YId2.js.map +0 -1
package/package.json
CHANGED
|
@@ -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(() =>
|
|
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
|
-
|
|
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
|
};
|