{"action":"created","issue":{"url":"https://api.github.com/repos/nestjs/graphql/issues/22","repository_url":"https://api.github.com/repos/nestjs/graphql","labels_url":"https://api.github.com/repos/nestjs/graphql/issues/22/labels{/name}","comments_url":"https://api.github.com/repos/nestjs/graphql/issues/22/comments","events_url":"https://api.github.com/repos/nestjs/graphql/issues/22/events","html_url":"https://github.com/nestjs/graphql/pull/22","id":324668094,"node_id":"MDExOlB1bGxSZXF1ZXN0MTg5MjExMjE5","number":22,"title":"Fixed undefined instance error when combined with Angular Universal","user":{"login":"bojidaryovchev","id":8954749,"node_id":"MDQ6VXNlcjg5NTQ3NDk=","avatar_url":"https://avatars0.githubusercontent.com/u/8954749?v=4","gravatar_id":"","url":"https://api.github.com/users/bojidaryovchev","html_url":"https://github.com/bojidaryovchev","followers_url":"https://api.github.com/users/bojidaryovchev/followers","following_url":"https://api.github.com/users/bojidaryovchev/following{/other_user}","gists_url":"https://api.github.com/users/bojidaryovchev/gists{/gist_id}","starred_url":"https://api.github.com/users/bojidaryovchev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bojidaryovchev/subscriptions","organizations_url":"https://api.github.com/users/bojidaryovchev/orgs","repos_url":"https://api.github.com/users/bojidaryovchev/repos","events_url":"https://api.github.com/users/bojidaryovchev/events{/privacy}","received_events_url":"https://api.github.com/users/bojidaryovchev/received_events","type":"User","site_admin":false},"labels":[{"id":948477014,"node_id":"MDU6TGFiZWw5NDg0NzcwMTQ=","url":"https://api.github.com/repos/nestjs/graphql/labels/potential%20issue","name":"potential issue","color":"f9d0c4","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-05-19T23:24:09Z","updated_at":"2018-09-03T11:59:41Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/nestjs/graphql/pulls/22","html_url":"https://github.com/nestjs/graphql/pull/22","diff_url":"https://github.com/nestjs/graphql/pull/22.diff","patch_url":"https://github.com/nestjs/graphql/pull/22.patch"},"body":"I integrated grapql in my project (https://github.com/bojidaryovchev/nest-angular/tree/master/src/server/modules) following this example https://github.com/nestjs/nest/tree/master/sample/12-graphql-apollo.. But I also have Angular Universal from the angular universal example.. And I found out that when we have both our GraphqlModule and AngularUniversalModule, an undefined instance appears in the modules instances in the explore and flapMap functions in resolvers-explorer.service.. Follow the images for further information:\r\n\r\nhttps://ibb.co/hhX5RT\r\nhttps://ibb.co/fujKmT\r\nhttps://ibb.co/cafs6T\r\n\r\nI found this fix to make things work however I am not completely sure that it is sufficient.. It seems to be, but I cannot determine.. Anyway, I shall make a pull request"},"comment":{"url":"https://api.github.com/repos/nestjs/graphql/issues/comments/418094174","html_url":"https://github.com/nestjs/graphql/pull/22#issuecomment-418094174","issue_url":"https://api.github.com/repos/nestjs/graphql/issues/22","id":418094174,"node_id":"MDEyOklzc3VlQ29tbWVudDQxODA5NDE3NA==","user":{"login":"matcic","id":17479103,"node_id":"MDQ6VXNlcjE3NDc5MTAz","avatar_url":"https://avatars0.githubusercontent.com/u/17479103?v=4","gravatar_id":"","url":"https://api.github.com/users/matcic","html_url":"https://github.com/matcic","followers_url":"https://api.github.com/users/matcic/followers","following_url":"https://api.github.com/users/matcic/following{/other_user}","gists_url":"https://api.github.com/users/matcic/gists{/gist_id}","starred_url":"https://api.github.com/users/matcic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matcic/subscriptions","organizations_url":"https://api.github.com/users/matcic/orgs","repos_url":"https://api.github.com/users/matcic/repos","events_url":"https://api.github.com/users/matcic/events{/privacy}","received_events_url":"https://api.github.com/users/matcic/received_events","type":"User","site_admin":false},"created_at":"2018-09-03T11:59:41Z","updated_at":"2018-09-03T11:59:41Z","author_association":"NONE","body":"@kamilmysliwiec something similar happened to me as well while trying to apply some permission policies to my Graphql resolvers based on custom decorators. The thing is that I believe [here](https://github.com/nestjs/graphql/blob/master/lib/services/base-explorer.service.ts#L24) the instance property is undefined for any injected instance that is defined as a provider belonging to the current module (which has not been instantiated yet). A simple `filter(value => value.instance)` (similar to what @bojidaryovchev suggested) fixed for me. Please let us know if this looks like a reasonable fix 😄 "}}
{"actor":{"display_login":"matcic"}}