{"action":"created","issue":{"url":"https://api.github.com/repos/strongloop/loopback-next/issues/1352","repository_url":"https://api.github.com/repos/strongloop/loopback-next","labels_url":"https://api.github.com/repos/strongloop/loopback-next/issues/1352/labels{/name}","comments_url":"https://api.github.com/repos/strongloop/loopback-next/issues/1352/comments","events_url":"https://api.github.com/repos/strongloop/loopback-next/issues/1352/events","html_url":"https://github.com/strongloop/loopback-next/issues/1352","id":326176864,"node_id":"MDU6SXNzdWUzMjYxNzY4NjQ=","number":1352,"title":"Inclusion of related models [MVP]","user":{"login":"dhmlau","id":25489897,"node_id":"MDQ6VXNlcjI1NDg5ODk3","avatar_url":"https://avatars3.githubusercontent.com/u/25489897?v=4","gravatar_id":"","url":"https://api.github.com/users/dhmlau","html_url":"https://github.com/dhmlau","followers_url":"https://api.github.com/users/dhmlau/followers","following_url":"https://api.github.com/users/dhmlau/following{/other_user}","gists_url":"https://api.github.com/users/dhmlau/gists{/gist_id}","starred_url":"https://api.github.com/users/dhmlau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhmlau/subscriptions","organizations_url":"https://api.github.com/users/dhmlau/orgs","repos_url":"https://api.github.com/users/dhmlau/repos","events_url":"https://api.github.com/users/dhmlau/events{/privacy}","received_events_url":"https://api.github.com/users/dhmlau/received_events","type":"User","site_admin":false},"labels":[{"id":1203633367,"node_id":"MDU6TGFiZWwxMjAzNjMzMzY3","url":"https://api.github.com/repos/strongloop/loopback-next/labels/2019Q4","name":"2019Q4","color":"494bbc","default":false},{"id":670384119,"node_id":"MDU6TGFiZWw2NzAzODQxMTk=","url":"https://api.github.com/repos/strongloop/loopback-next/labels/Juggler","name":"Juggler","color":"fbca04","default":false},{"id":1068517047,"node_id":"MDU6TGFiZWwxMDY4NTE3MDQ3","url":"https://api.github.com/repos/strongloop/loopback-next/labels/Relations","name":"Relations","color":"fcc53a","default":false},{"id":593551267,"node_id":"MDU6TGFiZWw1OTM1NTEyNjc=","url":"https://api.github.com/repos/strongloop/loopback-next/labels/epic","name":"epic","color":"c5def5","default":false},{"id":1117078886,"node_id":"MDU6TGFiZWwxMTE3MDc4ODg2","url":"https://api.github.com/repos/strongloop/loopback-next/labels/feature%20parity","name":"feature parity","color":"f45fbe","default":false},{"id":534463437,"node_id":"MDU6TGFiZWw1MzQ0NjM0Mzc=","url":"https://api.github.com/repos/strongloop/loopback-next/labels/p1","name":"p1","color":"b60205","default":false},{"id":1114112572,"node_id":"MDU6TGFiZWwxMTE0MTEyNTcy","url":"https://api.github.com/repos/strongloop/loopback-next/labels/user%20adoption","name":"user adoption","color":"bae2f2","default":false}],"state":"open","locked":false,"assignee":{"login":"bajtos","id":1140553,"node_id":"MDQ6VXNlcjExNDA1NTM=","avatar_url":"https://avatars1.githubusercontent.com/u/1140553?v=4","gravatar_id":"","url":"https://api.github.com/users/bajtos","html_url":"https://github.com/bajtos","followers_url":"https://api.github.com/users/bajtos/followers","following_url":"https://api.github.com/users/bajtos/following{/other_user}","gists_url":"https://api.github.com/users/bajtos/gists{/gist_id}","starred_url":"https://api.github.com/users/bajtos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bajtos/subscriptions","organizations_url":"https://api.github.com/users/bajtos/orgs","repos_url":"https://api.github.com/users/bajtos/repos","events_url":"https://api.github.com/users/bajtos/events{/privacy}","received_events_url":"https://api.github.com/users/bajtos/received_events","type":"User","site_admin":false},"assignees":[{"login":"bajtos","id":1140553,"node_id":"MDQ6VXNlcjExNDA1NTM=","avatar_url":"https://avatars1.githubusercontent.com/u/1140553?v=4","gravatar_id":"","url":"https://api.github.com/users/bajtos","html_url":"https://github.com/bajtos","followers_url":"https://api.github.com/users/bajtos/followers","following_url":"https://api.github.com/users/bajtos/following{/other_user}","gists_url":"https://api.github.com/users/bajtos/gists{/gist_id}","starred_url":"https://api.github.com/users/bajtos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bajtos/subscriptions","organizations_url":"https://api.github.com/users/bajtos/orgs","repos_url":"https://api.github.com/users/bajtos/repos","events_url":"https://api.github.com/users/bajtos/events{/privacy}","received_events_url":"https://api.github.com/users/bajtos/received_events","type":"User","site_admin":false},{"login":"agnes512","id":50331796,"node_id":"MDQ6VXNlcjUwMzMxNzk2","avatar_url":"https://avatars2.githubusercontent.com/u/50331796?v=4","gravatar_id":"","url":"https://api.github.com/users/agnes512","html_url":"https://github.com/agnes512","followers_url":"https://api.github.com/users/agnes512/followers","following_url":"https://api.github.com/users/agnes512/following{/other_user}","gists_url":"https://api.github.com/users/agnes512/gists{/gist_id}","starred_url":"https://api.github.com/users/agnes512/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agnes512/subscriptions","organizations_url":"https://api.github.com/users/agnes512/orgs","repos_url":"https://api.github.com/users/agnes512/repos","events_url":"https://api.github.com/users/agnes512/events{/privacy}","received_events_url":"https://api.github.com/users/agnes512/received_events","type":"User","site_admin":false}],"milestone":null,"comments":37,"created_at":"2018-05-24T15:33:48Z","updated_at":"2019-11-12T17:03:29Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"## Description / Steps to reproduce / Feature proposal\r\nFollow up task for PR #1342 \r\n\r\nInclusion of related models (same as LB3)\r\nFor example, `Customer` model has `{include: ['order']}`.  When query on `Customer`, the result should includes the `Order` array. \r\n\r\nDuplicates:\r\n - Include related models in \"GET /mymodels\" results #1889\r\n - https://stackoverflow.com/questions/53162562/loopback-4-hasmany-include-filter-error-500/53172949\r\n\r\nFollow-up stories:\r\n - Add support for \"include\" and \"fields\" to findById (REST API) #1721\r\n \r\n## Acceptance Criteria\r\n\r\n### MVP scope\r\n\r\n2019Q3\r\n- [x] Add `keyFrom` to resolved relation metadata #3441\r\n- [x] Test relations against databases #3442\r\n- [x] Add `findByForeignKeys` helper (initial version) #3443\r\n- [x] Introduce `InclusionResolver` concept #3445\r\n- [x] Include related models in `DefaultCrudRepository` #3446\r\n- [x] Implement InclusionResolver for hasMany relation #3447\r\n- [x] Implement InclusionResolver for belongsTo relation #3448\r\n- [x] Implement InclusionResolver for hasOne relation #3449\r\n- [x] Update `todo-list` example to use inclusion resolver #3450\r\n\r\n2019Q4\r\n- [ ] Reject create/update requests when data contains navigational properties #3439\r\n- [x] Add inclusion resolvers to `lb4 relation` CLI #3451\r\n- [ ] Verify relation type in `resolve{Relation}Metadata` #3440\r\n- [x] Run repository tests for PostgreSQL #3436\r\n- [ ] Run repository tests for Cloudant #3437\r\n- [x] Blog post: announce Inclusion of related models #3452\r\n\r\n### Out of MVP scope\r\n\r\n- [ ] Support `inq` splitting in `findByForeignKeys` #3444\r\n- [ ] Include related models with a custom scope #3453\r\n- [ ] Recursive inclusion of related models #3454\r\n- [ ] Reject queries with incompatible \"filter.fields\" and \"filter.include\" #3455\r\n- [ ] Spike: robust handling of ObjectID type for MongoDB #3456\r\n\r\nSee https://github.com/strongloop/loopback-next/issues/3585 for the full list."},"comment":{"url":"https://api.github.com/repos/strongloop/loopback-next/issues/comments/552987912","html_url":"https://github.com/strongloop/loopback-next/issues/1352#issuecomment-552987912","issue_url":"https://api.github.com/repos/strongloop/loopback-next/issues/1352","id":552987912,"node_id":"MDEyOklzc3VlQ29tbWVudDU1Mjk4NzkxMg==","user":{"login":"pratikjaiswal15","id":31253688,"node_id":"MDQ6VXNlcjMxMjUzNjg4","avatar_url":"https://avatars3.githubusercontent.com/u/31253688?v=4","gravatar_id":"","url":"https://api.github.com/users/pratikjaiswal15","html_url":"https://github.com/pratikjaiswal15","followers_url":"https://api.github.com/users/pratikjaiswal15/followers","following_url":"https://api.github.com/users/pratikjaiswal15/following{/other_user}","gists_url":"https://api.github.com/users/pratikjaiswal15/gists{/gist_id}","starred_url":"https://api.github.com/users/pratikjaiswal15/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pratikjaiswal15/subscriptions","organizations_url":"https://api.github.com/users/pratikjaiswal15/orgs","repos_url":"https://api.github.com/users/pratikjaiswal15/repos","events_url":"https://api.github.com/users/pratikjaiswal15/events{/privacy}","received_events_url":"https://api.github.com/users/pratikjaiswal15/received_events","type":"User","site_admin":false},"created_at":"2019-11-12T17:03:29Z","updated_at":"2019-11-12T17:03:29Z","author_association":"NONE","body":"Sir, does loopback's current version supports inclusion of three models where a model has has many relation with other two? If not then what is alternative."}}
{"actor":{"display_login":"pratikjaiswal15"}}