I have an issue with creating a dynamic query that can be updated by a search bar. The current issue is that I get an “Invalid Predicate” error when passing the filter/query string as a variable vs hardcoding it in. I can figure out why this works:
const result = useQuery('Player').filtered(
`'clubId == $0 AND _id != $1', userProfile.clubId, userProfile._id`
);
But this gives the invalid predicat eerror:
let queryStr = ('clubId == $0 AND _id != $1', userProfile.clubId, userProfile._id);
const result = useQuery('Player').filtered(
queryStr
);
Any help or insight is greatly appreciated.