Skip to content

Commit 896fc0a

Browse files
feat: and or
1 parent ee9a44b commit 896fc0a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/sdk/src/convertQuerytoClause.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ import * as torii from "@dojoengine/torii-client";
22
import { SchemaType } from "./types";
33

44
export function convertQueryToClause<T extends SchemaType>(
5-
query: Partial<T>
5+
query: Partial<T>,
6+
operator: "And" | "Or" = "And"
67
): torii.Clause {
78
const clauses: torii.Clause[] = [];
89

@@ -37,10 +38,10 @@ export function convertQueryToClause<T extends SchemaType>(
3738
return clauses[0];
3839
}
3940

40-
// If there are multiple clauses, combine them with an AND operator
41+
// Combine clauses with the specified operator
4142
return {
4243
Composite: {
43-
operator: "And",
44+
operator: operator,
4445
clauses: clauses,
4546
},
4647
};

0 commit comments

Comments
 (0)