Closed jermay closed 2 years ago
Any update on this? Also finding that queries on relations are not returning anything:
let relation = page.relation("posts")
relation.query().find({
success: function (list) {
console.log("connection page successfully found posts:", posts)
setPosts(posts)
setIsLoading(false)
}, error: function(error) {
console.log("ERROR: ", error)
}
});
Never hits the success callback.
This is solved I think long time ago
for all questions and discussions please use forum https://forum.moralis.io
Hello past Nick, the Moralis documentation is wrong here, that's why you got stuck. Try calling find()
and then waiting for the promise to resolve:
const connectionsRelation = currentAccount.relation("Connections")
connectionsRelation.query().find().then(function (results) {
setConnections(results)
})
.catch(function (error) {
console.log(error)
})
I think the relation query docs are incorrect https://docs.moralis.io/objects#relational-data
There is no "success" callback function defined on
ParseQuery.find()
see the API docs here: http://parseplatform.org/Parse-SDK-JS/api/3.2.0/Parse.Query.html#findWhen I try using promises in the Moralis Dashboard JS Console it returns no data. In the Browser the data and relations are defined and can be navigated through.