@coderich/autograph 0.13.52 → 0.13.53
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/schema/Schema.js +1 -1
package/package.json
CHANGED
package/src/schema/Schema.js
CHANGED
|
@@ -564,7 +564,7 @@ module.exports = class Schema {
|
|
|
564
564
|
const [modelKey, ...fieldKeys] = path.split('.');
|
|
565
565
|
const $model = Object.values(this.#schema.models).find(el => el[prop] === modelKey);
|
|
566
566
|
if (!$model || !fieldKeys.length) return $model;
|
|
567
|
-
return fieldKeys.reduce((parent, key) => Object.values(parent.fields || parent.model
|
|
567
|
+
return fieldKeys.reduce((parent, key) => Object.values(parent.fields || parent.model?.fields || {}).find(el => el[prop] === key) || parent, $model);
|
|
568
568
|
})();
|
|
569
569
|
return resolvePathCache[path];
|
|
570
570
|
};
|