Users Object referenced through pointer only returns current user attributes

Hello, I have a Post object where I also save the user (pointer to the User object).
The user that is saved is from the one from this line const { user } = useMoralis(); so there’s no issue is saving it.
When I retrieve all my posts, where I have 2 users in total saved, the first user which is the one logged in comes with attributes, and the second comes without.
If I switch wallets and try the same call with the other user same thing happens. The user that comes with the populated attributes is the one logged in.

Yes, I tried with masterKey and I also tried with query.include(“user”), but when I do this the user that comes without attributes, now comes as undefined

where did you use this? as you can not use master key in front end

did you try with .select and .include at the same time?

you have the user id there and you can make another query with that user id in case that you don’t make it work somehow

“did you try with .select and .include at the same time?”. Yes, I did.
I use it from the front-end, I query the DB without a cloud function.
And yes, I can query the DB again no problem, but this functionality is kinda weird.

it is not going to work in front end because you can not use master key in front end, you can try it with a cloud function.

you can not get the information about all the users in front end directly because every user row has an ACL so that only current user can get that information for his own row and not for any other users.

1 Like