react-query-lightbase-codegen 3.1.4 → 3.1.6
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.
|
@@ -65,7 +65,7 @@ ${deprecatedComment}export const ${namedQueryOptions} = (
|
|
|
65
65
|
${destructuringLine}
|
|
66
66
|
const enabled = ${enabledLogic};
|
|
67
67
|
return queryOptions({
|
|
68
|
-
queryKey: ['${(0, utils_1.camelCase)(operationId)}', ${queryKeyParams}],
|
|
68
|
+
queryKey: ['${(0, utils_1.camelCase)(operationId)}', ${queryKeyParams}, axiosConfig?.params],
|
|
69
69
|
queryFn: enabled ? () => apiClient.${namedQuery}(${functionCall}) : skipToken,
|
|
70
70
|
});
|
|
71
71
|
};`;
|
package/dist/utils.js
CHANGED
|
@@ -211,6 +211,9 @@ function getTypeFromSchema(schema) {
|
|
|
211
211
|
}
|
|
212
212
|
// Handle types based on the "type" property
|
|
213
213
|
if ("type" in schema) {
|
|
214
|
+
// OpenAPI 3.1 "null" type (e.g. in anyOf: [{ $ref: "..." }, { type: "null" }])
|
|
215
|
+
if (schema.type === "null")
|
|
216
|
+
return "null";
|
|
214
217
|
// OpenAPI 3.1 supports type as an array, e.g. ["string", "null"]
|
|
215
218
|
if (Array.isArray(schema.type)) {
|
|
216
219
|
const types = schema.type.filter((t) => t !== "null");
|
package/package.json
CHANGED
|
@@ -88,7 +88,7 @@ ${deprecatedComment}export const ${namedQueryOptions} = (
|
|
|
88
88
|
${destructuringLine}
|
|
89
89
|
const enabled = ${enabledLogic};
|
|
90
90
|
return queryOptions({
|
|
91
|
-
queryKey: ['${camelCase(operationId)}', ${queryKeyParams}],
|
|
91
|
+
queryKey: ['${camelCase(operationId)}', ${queryKeyParams}, axiosConfig?.params],
|
|
92
92
|
queryFn: enabled ? () => apiClient.${namedQuery}(${functionCall}) : skipToken,
|
|
93
93
|
});
|
|
94
94
|
};`;
|
package/src/utils.ts
CHANGED
|
@@ -239,6 +239,9 @@ export function getTypeFromSchema(
|
|
|
239
239
|
|
|
240
240
|
// Handle types based on the "type" property
|
|
241
241
|
if ("type" in schema) {
|
|
242
|
+
// OpenAPI 3.1 "null" type (e.g. in anyOf: [{ $ref: "..." }, { type: "null" }])
|
|
243
|
+
if ((schema.type as string) === "null") return "null";
|
|
244
|
+
|
|
242
245
|
// OpenAPI 3.1 supports type as an array, e.g. ["string", "null"]
|
|
243
246
|
if (Array.isArray(schema.type)) {
|
|
244
247
|
const types = (schema.type as string[]).filter((t) => t !== "null");
|