Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to execute multiple include query in loopback #3476

Closed
pavanchandanam opened this issue Jul 31, 2019 · 4 comments
Closed

Unable to execute multiple include query in loopback #3476

pavanchandanam opened this issue Jul 31, 2019 · 4 comments
Assignees
Labels

Comments

@pavanchandanam
Copy link

let marketingprograms: any = await this.marketingProgramRepository.find({
include: {
relation: 'Brand', // include the brand model
scope: { // further filter the owner object
fields: ['brandName'], // only show one field
include: {
relation: 'Country',
scope: {
fields: ['countryId'],
scope: {
where: { MktngPgmId: marketingProgramId }
}
}
}
}
}
});

it is showing the error on the first include line as

Argument of type '{ include: { relation: string; scope: { fields: string[]; include: { relation: string; scope: { fields: string[]; scope: { where: { MktngPgmId: any; }; }; }; }; }; }; }' is not assignable to parameter of type 'Filter'.
Types of property 'include' are incompatible.
Type '{ relation: string; scope: { fields: string[]; include: { relation: string; scope: { fields: string[]; scope: { where: { MktngPgmId: any; }; }; }; }; }; }' is not assignable to type 'Inclusion[]'.
Object literal may only specify known properties, and 'relation' does not exist in type 'Inclusion[]'.

@dhmlau
Copy link
Member

dhmlau commented Jul 31, 2019

@jannyHou, could you please take a look? Thanks.

@jannyHou
Copy link
Contributor

jannyHou commented Aug 1, 2019

@pavanchandanam The inclusion feature is not supported yet, we are working on retrieving navigational properties incrementally, see epic #1352.

The proposal and implementation stories are explained in #3387

@dhmlau
Copy link
Member

dhmlau commented Aug 13, 2019

@jannyHou, should we close this as duplicate of #1352?

@jannyHou
Copy link
Contributor

Yeah point it to #1352 is reasonable to me.
Feel free to reopen the issue if you have more questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants