diff --git a/packages/sdk/src/convertQueryToEntityKeyClauses.ts b/packages/sdk/src/convertQueryToEntityKeyClauses.ts index 6b5e34ec..4bc36a15 100644 --- a/packages/sdk/src/convertQueryToEntityKeyClauses.ts +++ b/packages/sdk/src/convertQueryToEntityKeyClauses.ts @@ -22,8 +22,9 @@ export function convertQueryToEntityKeyClauses( const { entityIds, ...namespaces } = query; - if (entityIds && entityIds.length > 0) { - clauses.push({ HashedKeys: entityIds }); + if (entityIds && entityIds.length && (entityIds.length as number) > 0) { + clauses.push({ HashedKeys: entityIds as string[] }); + return clauses; } clauses.push(...convertQueryToKeysClause(namespaces, schema));