Parse Live Query Include

Hello,
I’m using parse live query for messages, in every message, I have a user pointer “userInfo”. I want the parse live query to send this populated when it sends this new message to all observers.
For example, I’m receiving this below response in a live query stream on a new message.
I want userInfo field to include the actual info of the user instead of just a pointer.

{"op":"create","clientId":"194a758a-825b-478a-bc58-3cd722291c04","installationId":"18394ca6-c4f8-4f25-8e64-b149623f9553","requestId":5,"object":{"message":"MESSAGE","liveBreak":{"__type":"Pointer","className":"LiveBreak","objectId":"7pPLFeFVoY"},"userInfo":{"__type":"Pointer","className":"users","objectId":"63b40841ee9c12a39fe03fdc"},"createdAt":"2023-01-10T20:53:45.397Z","updatedAt":"2023-01-10T20:53:45.397Z","__type":"Object","className":"ChatMessage","objectId":"Ec3GkYo50r"}}```

The LiveQuery server currently doesn’t support this. You can see an old, but still relevant discussion about this here:

You can use afterLiveQueryEvent


Parse.Cloud.afterLiveQueryEvent('TestObject', async req => {
      await req.object.get("key").fetch({ sessionToken: req.user.getSessionToken() });
});


1 Like