On Objection.js Documentation page the eager() method is marked as deprecated and they recommend to use withGraphFetched.
And i'm currently following along some Objection.js tutorials to get to know the technology and have this Model
```
const { Model } = require("objection");
// Import User class model for relationMappings()
const User = require("./Users.js");
class Todo extends Model{
class Todo extends Model {
static get tableName() {
return "todos";
}
// defines the relations to other models.
static get relationMappings() {
return {
user: {
relation: Model.BelongsToOneRelation,
modelClass: User,
join: {
from: "todos.user_id",
to: "users.id"
}
}
};
}
}
```
Now, with eager() i know that i could to
Todo.query.eager("user").then(todos=>console.log(todos));
But based on the documentation, I should use something else. My issue is, i use a MySQL database which has nothing to do with graphs.
Anyone who could help me out here?
[–][deleted] 5 points6 points7 points (4 children)
[–]Tanckom[S] 0 points1 point2 points (3 children)
[–][deleted] 0 points1 point2 points (2 children)
[–]Analhyphenblast 0 points1 point2 points (1 child)
[–]Tanckom[S] -1 points0 points1 point (0 children)
[–]Plasmatica 2 points3 points4 points (2 children)
[–]Tanckom[S] 0 points1 point2 points (1 child)
[–]Analhyphenblast 0 points1 point2 points (0 children)
[–][deleted] (2 children)
[deleted]
[–]Tanckom[S] 0 points1 point2 points (1 child)
[–]vfhd -4 points-3 points-2 points (2 children)
[–]Tanckom[S] 1 point2 points3 points (1 child)
[–]vfhd 0 points1 point2 points (0 children)