{"action":"created","issue":{"url":"https://api.github.com/repos/JonnyBGod/loopback-include-through-mixin/issues/4","repository_url":"https://api.github.com/repos/JonnyBGod/loopback-include-through-mixin","labels_url":"https://api.github.com/repos/JonnyBGod/loopback-include-through-mixin/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/JonnyBGod/loopback-include-through-mixin/issues/4/comments","events_url":"https://api.github.com/repos/JonnyBGod/loopback-include-through-mixin/issues/4/events","html_url":"https://github.com/JonnyBGod/loopback-include-through-mixin/issues/4","id":230422564,"number":4,"title":"Noes not include through properties when querying at a 2nd level","user":{"login":"frankorama","id":12051927,"avatar_url":"https://avatars0.githubusercontent.com/u/12051927?v=3","gravatar_id":"","url":"https://api.github.com/users/frankorama","html_url":"https://github.com/frankorama","followers_url":"https://api.github.com/users/frankorama/followers","following_url":"https://api.github.com/users/frankorama/following{/other_user}","gists_url":"https://api.github.com/users/frankorama/gists{/gist_id}","starred_url":"https://api.github.com/users/frankorama/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frankorama/subscriptions","organizations_url":"https://api.github.com/users/frankorama/orgs","repos_url":"https://api.github.com/users/frankorama/repos","events_url":"https://api.github.com/users/frankorama/events{/privacy}","received_events_url":"https://api.github.com/users/frankorama/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-05-22T14:54:59Z","updated_at":"2017-05-22T16:13:49Z","closed_at":null,"body":"we have a Team model linked to a Member model though a TeamRole model.  In the TeamRole we define \"canCreate\", \"canUpdate\", etc. permissions.  This is a hasManyThrough relation.\r\n\r\nTeam <--> TeamRole <--> Member\r\n\r\nNext we have a document model, where the author property is a relation (belongsTo) Members, and the team property (belongsTo) Team.\r\n\r\nDocument.team --> Team\r\nDocument.author --> Membe\r\n\r\nTo query the documents and get the author and team, I perform the following include:\r\n`{\"include\":[\"author\",\"team\"]}`\r\nWorks great.\r\n\r\nNow i want to get the team members at the same time:\r\n`{\"include\":[\"author\",{\"team\":\"members\"}]}`\r\nNow I have the team with a list of members, but I don't have any data from the TeamRole model.\r\n\r\nI tried using the mixin, but without success.  Is there a different syntax that I'm not aware of?\r\n\r\nattempt 1:\r\n`{\"include\":[\"author\",{\"team\": \"members\", \"includeThrough\":true}]}`\r\n\r\nattempt 2:\r\n```\r\n{\r\n  \"include\":{\r\n    \"relation\":\"team\",\r\n    \"scope\":{\r\n      \"include\":{ \r\n        \"relation\":\"members\"\r\n        },\r\n      \"includeThrough\":true\r\n    }\r\n  }\r\n}\r\n```\r\n\r\nIs your mixing meant to perform this way?  Is it possible to get the member roles when including team from another model?"},"comment":{"url":"https://api.github.com/repos/JonnyBGod/loopback-include-through-mixin/issues/comments/303147234","html_url":"https://github.com/JonnyBGod/loopback-include-through-mixin/issues/4#issuecomment-303147234","issue_url":"https://api.github.com/repos/JonnyBGod/loopback-include-through-mixin/issues/4","id":303147234,"user":{"login":"frankorama","id":12051927,"avatar_url":"https://avatars0.githubusercontent.com/u/12051927?v=3","gravatar_id":"","url":"https://api.github.com/users/frankorama","html_url":"https://github.com/frankorama","followers_url":"https://api.github.com/users/frankorama/followers","following_url":"https://api.github.com/users/frankorama/following{/other_user}","gists_url":"https://api.github.com/users/frankorama/gists{/gist_id}","starred_url":"https://api.github.com/users/frankorama/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frankorama/subscriptions","organizations_url":"https://api.github.com/users/frankorama/orgs","repos_url":"https://api.github.com/users/frankorama/repos","events_url":"https://api.github.com/users/frankorama/events{/privacy}","received_events_url":"https://api.github.com/users/frankorama/received_events","type":"User","site_admin":false},"created_at":"2017-05-22T16:13:49Z","updated_at":"2017-05-22T16:13:49Z","body":"Looked through the code and saw that the properties are being added using the 'afterRemote' remote hook, and an include 2 levels down is not using a remove method to add the data, so to answer my own questions: no, this mixin will only work when calling the Team model with an include. not the Document model."}}
{"actor":{"display_login":"frankorama"}}