You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
await this.app.service('slots').Model.query().eager('shift');
or
await this.app.service('shifts').Model.query().eager('slots');
I get the following errors:
"slots.relationMappings.shift: Cannot read property 'get' of undefined"
"shifts.relationMappings.slots: Cannot read property 'get' of undefined"
Any clue why this could be happening? I'm using feathers-objection and have whitelisted eager.
I opened an issue on the objections github page but sami asked me to open an issue here as my model looks ok and it could be a but in feathers-objection.
The text was updated successfully, but these errors were encountered:
If I handle the migrations separately and only export model class from the generated shifts.model.js and slots.model.js file, then it seems to work fine.
Essentially, only leave the following code at the end of the file.
module.exports = function (app) {
return shifts;
};
I'm closing the issue as it's resolved for me.
This is actually a serious issue and I don't know why it was closed and never fixed.
migration should not be exported with the model and should be defined in his own file.
Exporting migration with the model is not only dangerous but it also break objectionjs on some points like relation mappings...
So feathers-objection should define models and migrations in two different files and only export the model in the model class file
Hi,
I've the following relations:
but when I do the following :
await this.app.service('slots').Model.query().eager('shift');
or
await this.app.service('shifts').Model.query().eager('slots');
I get the following errors:
"slots.relationMappings.shift: Cannot read property 'get' of undefined"
"shifts.relationMappings.slots: Cannot read property 'get' of undefined"
Any clue why this could be happening? I'm using feathers-objection and have whitelisted eager.
I opened an issue on the objections github page but sami asked me to open an issue here as my model looks ok and it could be a but in feathers-objection.
The text was updated successfully, but these errors were encountered: