@props-labs/mesh-os 0.1.12 → 0.1.13
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/core/client.js +7 -1
- package/package.json +1 -1
package/dist/core/client.js
CHANGED
@@ -743,6 +743,12 @@ class MeshOS {
|
|
743
743
|
*/
|
744
744
|
async getMemories(options) {
|
745
745
|
const { where, orderBy, limit, offset, distinctOn } = options;
|
746
|
+
// Convert orderBy to Hasura format
|
747
|
+
const hasuraOrderBy = orderBy?.map(({ column, order }) => {
|
748
|
+
// Convert camelCase to snake_case for column names
|
749
|
+
const snakeCaseColumn = column.replace(/[A-Z]/g, letter => `_${letter.toLowerCase()}`);
|
750
|
+
return { [snakeCaseColumn]: order };
|
751
|
+
});
|
746
752
|
// Build the GraphQL query dynamically
|
747
753
|
const query = `
|
748
754
|
query GetMemories(
|
@@ -772,7 +778,7 @@ class MeshOS {
|
|
772
778
|
`;
|
773
779
|
const result = await this.executeQuery(query, {
|
774
780
|
where,
|
775
|
-
orderBy,
|
781
|
+
orderBy: hasuraOrderBy,
|
776
782
|
limit,
|
777
783
|
offset,
|
778
784
|
...(distinctOn ? { distinctOn } : {})
|