Skip to content

Nested objects retourned as Parse.Object and not as registered Subclass #1396

Description

@NadjibR

New Issue Checklist

Issue Description

When making a query with includeAll() to get nested objects, the main requested objects are returned as the subclass model, but children are returned as Parse.object.

Steps to reproduce

Parse.Query(Employee).includeAll().find(...);

Definition of Employee.ts

export default class Employee extends Parse.Object {
    constructor() {
        super('Employees');
    }
    .....
    get departmentId(): Department {
        return this.get('DepartmentId');
    }

    set departmentId(employeeDepartmentId: Department) {
        this.set('DepartmentId', employeeDepartmentId);
    }
}
Parse.Object.registerSubclass('Employees', Employee);

Definition of Department.ts

export default class Department extends Parse.Object {
    constructor() {
        super('Departments');
    }
    ....
}
Parse.Object.registerSubclass('Departments', Department);

Actual Outcome

The departmentId in the above example is retourned as Parse.Object and not as Department.

Expected Outcome

Children of 2nd and 3rd level should be retourned as their registred classes.

Environment

Server

  • Parse Server version: 4.4.0
  • Operating system: Really don't know
  • Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc): Back4app

Database

  • System (MongoDB or Postgres): MongoDB
  • Database version: 3.6
  • Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc): Back4app

Client

  • Parse JS SDK version: 3.3.0

Logs

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:questionSupport or code-level question

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions