{"action":"created","issue":{"url":"https://api.github.com/repos/prisma/graphql-prisma-typescript/issues/337","repository_url":"https://api.github.com/repos/prisma/graphql-prisma-typescript","labels_url":"https://api.github.com/repos/prisma/graphql-prisma-typescript/issues/337/labels{/name}","comments_url":"https://api.github.com/repos/prisma/graphql-prisma-typescript/issues/337/comments","events_url":"https://api.github.com/repos/prisma/graphql-prisma-typescript/issues/337/events","html_url":"https://github.com/prisma/graphql-prisma-typescript/pull/337","id":360523027,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE1NzU5NTc5","number":337,"title":"Move getUserId to context, fix TypeMap import","user":{"login":"brikou","id":383212,"node_id":"MDQ6VXNlcjM4MzIxMg==","avatar_url":"https://avatars3.githubusercontent.com/u/383212?v=4","gravatar_id":"","url":"https://api.github.com/users/brikou","html_url":"https://github.com/brikou","followers_url":"https://api.github.com/users/brikou/followers","following_url":"https://api.github.com/users/brikou/following{/other_user}","gists_url":"https://api.github.com/users/brikou/gists{/gist_id}","starred_url":"https://api.github.com/users/brikou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brikou/subscriptions","organizations_url":"https://api.github.com/users/brikou/orgs","repos_url":"https://api.github.com/users/brikou/repos","events_url":"https://api.github.com/users/brikou/events{/privacy}","received_events_url":"https://api.github.com/users/brikou/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-09-15T09:11:39Z","updated_at":"2018-09-18T13:07:27Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/prisma/graphql-prisma-typescript/pulls/337","html_url":"https://github.com/prisma/graphql-prisma-typescript/pull/337","diff_url":"https://github.com/prisma/graphql-prisma-typescript/pull/337.diff","patch_url":"https://github.com/prisma/graphql-prisma-typescript/pull/337.patch"},"body":"Now that `getUserId` is a method of `ctx` there is no more need to import utils, and IMHO context is meant to handle this.\r\n\r\nI also remove `Context.ts` from `src/resolvers/types` as it is infer with:\r\n\r\n```ts\r\nexport interface TypeMap extends ITypeMap {\r\n  Context: ReturnType<typeof import('../../context').context>\r\n  // ...\r\n}\r\n```\r\n\r\nNB: Consider this as a POC as it should be part of `graphql-resolver-codegen` and will next be overwritten on next generate, ping @divyenduz\r\n\r\nI also move prisma instance to `prisma.ts`, if we want to import it for script usage (fe: cronjob)\r\n"},"comment":{"url":"https://api.github.com/repos/prisma/graphql-prisma-typescript/issues/comments/422385851","html_url":"https://github.com/prisma/graphql-prisma-typescript/pull/337#issuecomment-422385851","issue_url":"https://api.github.com/repos/prisma/graphql-prisma-typescript/issues/337","id":422385851,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMjM4NTg1MQ==","user":{"login":"abhiaiyer91","id":2359375,"node_id":"MDQ6VXNlcjIzNTkzNzU=","avatar_url":"https://avatars0.githubusercontent.com/u/2359375?v=4","gravatar_id":"","url":"https://api.github.com/users/abhiaiyer91","html_url":"https://github.com/abhiaiyer91","followers_url":"https://api.github.com/users/abhiaiyer91/followers","following_url":"https://api.github.com/users/abhiaiyer91/following{/other_user}","gists_url":"https://api.github.com/users/abhiaiyer91/gists{/gist_id}","starred_url":"https://api.github.com/users/abhiaiyer91/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abhiaiyer91/subscriptions","organizations_url":"https://api.github.com/users/abhiaiyer91/orgs","repos_url":"https://api.github.com/users/abhiaiyer91/repos","events_url":"https://api.github.com/users/abhiaiyer91/events{/privacy}","received_events_url":"https://api.github.com/users/abhiaiyer91/received_events","type":"User","site_admin":false},"created_at":"2018-09-18T13:07:27Z","updated_at":"2018-09-18T13:07:27Z","author_association":"COLLABORATOR","body":"Thanks for the PR, I think if we're going to push this function into context, lets just pluck the userId from the jwt if Bearer is present and attach it to context directly."}}
{"actor":{"display_login":"abhiaiyer91"}}