{"action":"created","comment":{"url":"https://api.github.com/repos/graphql-cli/graphql-cli/pulls/comments/192079387","pull_request_review_id":124780496,"id":192079387,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5MjA3OTM4Nw==","diff_hunk":"@@ -128,27 +127,41 @@ export class Codegen {\n         }\n \n         if (generator === 'typegen') {\n+\n+          if (!output.typings || output.typings === '') {\n+            throw new Error(\"Please provide output.typings path to use typegen\")\n+          }\n+\n           inputSchemaPath = inputSchemaPath || '**/*.ts'\n-          const binPath = await getApolloCodegenBin()\n+          const binPath = require.resolve('apollo-codegen').replace('index.js', 'cli.js')\n           const tmpSchemaPath = getTmpPath()\n           fs.writeFileSync(\n             tmpSchemaPath,\n             JSON.stringify(await introspect(this.project.getSchema())),\n           )\n           const args = [\n             'generate',\n-            input,\n+            input || '{binding,prisma}/*.ts',\n             '--schema',\n             tmpSchemaPath,\n             '--output',\n             output.typings,\n             '--target',\n             language,\n           ]\n+\n           const child = crossSpawn.sync(binPath, args)\n+        \n+          if (child.error) {\n+            if (child.error.message === `spawnSync apollo-codegen ENOENT`) {\n+              throw new Error(`Generator apollo-codegen is not installed.`)","path":"src/cmds/codegen/codegen.ts","position":41,"original_position":41,"commit_id":"a1571620a157c09e7cfcd4437984e09ad7f9c407","original_commit_id":"a1571620a157c09e7cfcd4437984e09ad7f9c407","user":{"login":"marktani","id":1780597,"node_id":"MDQ6VXNlcjE3ODA1OTc=","avatar_url":"https://avatars1.githubusercontent.com/u/1780597?v=4","gravatar_id":"","url":"https://api.github.com/users/marktani","html_url":"https://github.com/marktani","followers_url":"https://api.github.com/users/marktani/followers","following_url":"https://api.github.com/users/marktani/following{/other_user}","gists_url":"https://api.github.com/users/marktani/gists{/gist_id}","starred_url":"https://api.github.com/users/marktani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marktani/subscriptions","organizations_url":"https://api.github.com/users/marktani/orgs","repos_url":"https://api.github.com/users/marktani/repos","events_url":"https://api.github.com/users/marktani/events{/privacy}","received_events_url":"https://api.github.com/users/marktani/received_events","type":"User","site_admin":false},"body":"Can we make this error message actionable? How can I usually fix this problem?","created_at":"2018-05-31T12:18:46Z","updated_at":"2018-05-31T12:19:44Z","html_url":"https://github.com/graphql-cli/graphql-cli/pull/311#discussion_r192079387","pull_request_url":"https://api.github.com/repos/graphql-cli/graphql-cli/pulls/311","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/graphql-cli/graphql-cli/pulls/comments/192079387"},"html":{"href":"https://github.com/graphql-cli/graphql-cli/pull/311#discussion_r192079387"},"pull_request":{"href":"https://api.github.com/repos/graphql-cli/graphql-cli/pulls/311"}}},"pull_request":{"url":"https://api.github.com/repos/graphql-cli/graphql-cli/pulls/311","id":191735329,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkxNzM1MzI5","html_url":"https://github.com/graphql-cli/graphql-cli/pull/311","diff_url":"https://github.com/graphql-cli/graphql-cli/pull/311.diff","patch_url":"https://github.com/graphql-cli/graphql-cli/pull/311.patch","issue_url":"https://api.github.com/repos/graphql-cli/graphql-cli/issues/311","number":311,"state":"open","locked":false,"title":"fix: make codegen more robust","user":{"login":"divyenduz","id":746482,"node_id":"MDQ6VXNlcjc0NjQ4Mg==","avatar_url":"https://avatars3.githubusercontent.com/u/746482?v=4","gravatar_id":"","url":"https://api.github.com/users/divyenduz","html_url":"https://github.com/divyenduz","followers_url":"https://api.github.com/users/divyenduz/followers","following_url":"https://api.github.com/users/divyenduz/following{/other_user}","gists_url":"https://api.github.com/users/divyenduz/gists{/gist_id}","starred_url":"https://api.github.com/users/divyenduz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/divyenduz/subscriptions","organizations_url":"https://api.github.com/users/divyenduz/orgs","repos_url":"https://api.github.com/users/divyenduz/repos","events_url":"https://api.github.com/users/divyenduz/events{/privacy}","received_events_url":"https://api.github.com/users/divyenduz/received_events","type":"User","site_admin":false},"body":"This PR does the following:-\r\n\r\n1. Fail fast on any errors and notify the user about a potential fix\r\n\r\n2. Refactor the logic to locate `apollo-codegen` binary to support `typegen`\r\n\r\n3. Provide a default input value to `typegen`\r\n\r\nI am testing this one one windows after which we can merge this and hopefully make our codegen users happy. Thanks! ","created_at":"2018-05-31T12:16:57Z","updated_at":"2018-05-31T12:19:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5392bcf79adc491bf4b66fdfa95bec860229486f","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/graphql-cli/graphql-cli/pulls/311/commits","review_comments_url":"https://api.github.com/repos/graphql-cli/graphql-cli/pulls/311/comments","review_comment_url":"https://api.github.com/repos/graphql-cli/graphql-cli/pulls/comments{/number}","comments_url":"https://api.github.com/repos/graphql-cli/graphql-cli/issues/311/comments","statuses_url":"https://api.github.com/repos/graphql-cli/graphql-cli/statuses/a1571620a157c09e7cfcd4437984e09ad7f9c407","head":{"label":"divyenduz:fix_codegen","ref":"fix_codegen","sha":"a1571620a157c09e7cfcd4437984e09ad7f9c407","user":{"login":"divyenduz","id":746482,"node_id":"MDQ6VXNlcjc0NjQ4Mg==","avatar_url":"https://avatars3.githubusercontent.com/u/746482?v=4","gravatar_id":"","url":"https://api.github.com/users/divyenduz","html_url":"https://github.com/divyenduz","followers_url":"https://api.github.com/users/divyenduz/followers","following_url":"https://api.github.com/users/divyenduz/following{/other_user}","gists_url":"https://api.github.com/users/divyenduz/gists{/gist_id}","starred_url":"https://api.github.com/users/divyenduz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/divyenduz/subscriptions","organizations_url":"https://api.github.com/users/divyenduz/orgs","repos_url":"https://api.github.com/users/divyenduz/repos","events_url":"https://api.github.com/users/divyenduz/events{/privacy}","received_events_url":"https://api.github.com/users/divyenduz/received_events","type":"User","site_admin":false},"repo":{"id":135558486,"node_id":"MDEwOlJlcG9zaXRvcnkxMzU1NTg0ODY=","name":"graphql-cli","full_name":"divyenduz/graphql-cli","owner":{"login":"divyenduz","id":746482,"node_id":"MDQ6VXNlcjc0NjQ4Mg==","avatar_url":"https://avatars3.githubusercontent.com/u/746482?v=4","gravatar_id":"","url":"https://api.github.com/users/divyenduz","html_url":"https://github.com/divyenduz","followers_url":"https://api.github.com/users/divyenduz/followers","following_url":"https://api.github.com/users/divyenduz/following{/other_user}","gists_url":"https://api.github.com/users/divyenduz/gists{/gist_id}","starred_url":"https://api.github.com/users/divyenduz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/divyenduz/subscriptions","organizations_url":"https://api.github.com/users/divyenduz/orgs","repos_url":"https://api.github.com/users/divyenduz/repos","events_url":"https://api.github.com/users/divyenduz/events{/privacy}","received_events_url":"https://api.github.com/users/divyenduz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/divyenduz/graphql-cli","description":"📟  Command line tool for common GraphQL development workflows","fork":true,"url":"https://api.github.com/repos/divyenduz/graphql-cli","forks_url":"https://api.github.com/repos/divyenduz/graphql-cli/forks","keys_url":"https://api.github.com/repos/divyenduz/graphql-cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/divyenduz/graphql-cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/divyenduz/graphql-cli/teams","hooks_url":"https://api.github.com/repos/divyenduz/graphql-cli/hooks","issue_events_url":"https://api.github.com/repos/divyenduz/graphql-cli/issues/events{/number}","events_url":"https://api.github.com/repos/divyenduz/graphql-cli/events","assignees_url":"https://api.github.com/repos/divyenduz/graphql-cli/assignees{/user}","branches_url":"https://api.github.com/repos/divyenduz/graphql-cli/branches{/branch}","tags_url":"https://api.github.com/repos/divyenduz/graphql-cli/tags","blobs_url":"https://api.github.com/repos/divyenduz/graphql-cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/divyenduz/graphql-cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/divyenduz/graphql-cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/divyenduz/graphql-cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/divyenduz/graphql-cli/statuses/{sha}","languages_url":"https://api.github.com/repos/divyenduz/graphql-cli/languages","stargazers_url":"https://api.github.com/repos/divyenduz/graphql-cli/stargazers","contributors_url":"https://api.github.com/repos/divyenduz/graphql-cli/contributors","subscribers_url":"https://api.github.com/repos/divyenduz/graphql-cli/subscribers","subscription_url":"https://api.github.com/repos/divyenduz/graphql-cli/subscription","commits_url":"https://api.github.com/repos/divyenduz/graphql-cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/divyenduz/graphql-cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/divyenduz/graphql-cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/divyenduz/graphql-cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/divyenduz/graphql-cli/contents/{+path}","compare_url":"https://api.github.com/repos/divyenduz/graphql-cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/divyenduz/graphql-cli/merges","archive_url":"https://api.github.com/repos/divyenduz/graphql-cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/divyenduz/graphql-cli/downloads","issues_url":"https://api.github.com/repos/divyenduz/graphql-cli/issues{/number}","pulls_url":"https://api.github.com/repos/divyenduz/graphql-cli/pulls{/number}","milestones_url":"https://api.github.com/repos/divyenduz/graphql-cli/milestones{/number}","notifications_url":"https://api.github.com/repos/divyenduz/graphql-cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/divyenduz/graphql-cli/labels{/name}","releases_url":"https://api.github.com/repos/divyenduz/graphql-cli/releases{/id}","deployments_url":"https://api.github.com/repos/divyenduz/graphql-cli/deployments","created_at":"2018-05-31T08:56:16Z","updated_at":"2018-05-31T08:56:18Z","pushed_at":"2018-05-31T12:13:42Z","git_url":"git://github.com/divyenduz/graphql-cli.git","ssh_url":"git@github.com:divyenduz/graphql-cli.git","clone_url":"https://github.com/divyenduz/graphql-cli.git","svn_url":"https://github.com/divyenduz/graphql-cli","homepage":"","size":1372,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"graphql-cli:master","ref":"master","sha":"0537adbcac9f84bf4a7da4210e0a8fe8d3abcec8","user":{"login":"graphql-cli","id":34035705,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM0MDM1NzA1","avatar_url":"https://avatars1.githubusercontent.com/u/34035705?v=4","gravatar_id":"","url":"https://api.github.com/users/graphql-cli","html_url":"https://github.com/graphql-cli","followers_url":"https://api.github.com/users/graphql-cli/followers","following_url":"https://api.github.com/users/graphql-cli/following{/other_user}","gists_url":"https://api.github.com/users/graphql-cli/gists{/gist_id}","starred_url":"https://api.github.com/users/graphql-cli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/graphql-cli/subscriptions","organizations_url":"https://api.github.com/users/graphql-cli/orgs","repos_url":"https://api.github.com/users/graphql-cli/repos","events_url":"https://api.github.com/users/graphql-cli/events{/privacy}","received_events_url":"https://api.github.com/users/graphql-cli/received_events","type":"Organization","site_admin":false},"repo":{"id":97463561,"node_id":"MDEwOlJlcG9zaXRvcnk5NzQ2MzU2MQ==","name":"graphql-cli","full_name":"graphql-cli/graphql-cli","owner":{"login":"graphql-cli","id":34035705,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM0MDM1NzA1","avatar_url":"https://avatars1.githubusercontent.com/u/34035705?v=4","gravatar_id":"","url":"https://api.github.com/users/graphql-cli","html_url":"https://github.com/graphql-cli","followers_url":"https://api.github.com/users/graphql-cli/followers","following_url":"https://api.github.com/users/graphql-cli/following{/other_user}","gists_url":"https://api.github.com/users/graphql-cli/gists{/gist_id}","starred_url":"https://api.github.com/users/graphql-cli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/graphql-cli/subscriptions","organizations_url":"https://api.github.com/users/graphql-cli/orgs","repos_url":"https://api.github.com/users/graphql-cli/repos","events_url":"https://api.github.com/users/graphql-cli/events{/privacy}","received_events_url":"https://api.github.com/users/graphql-cli/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/graphql-cli/graphql-cli","description":"📟  Command line tool for common GraphQL development workflows","fork":false,"url":"https://api.github.com/repos/graphql-cli/graphql-cli","forks_url":"https://api.github.com/repos/graphql-cli/graphql-cli/forks","keys_url":"https://api.github.com/repos/graphql-cli/graphql-cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/graphql-cli/graphql-cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/graphql-cli/graphql-cli/teams","hooks_url":"https://api.github.com/repos/graphql-cli/graphql-cli/hooks","issue_events_url":"https://api.github.com/repos/graphql-cli/graphql-cli/issues/events{/number}","events_url":"https://api.github.com/repos/graphql-cli/graphql-cli/events","assignees_url":"https://api.github.com/repos/graphql-cli/graphql-cli/assignees{/user}","branches_url":"https://api.github.com/repos/graphql-cli/graphql-cli/branches{/branch}","tags_url":"https://api.github.com/repos/graphql-cli/graphql-cli/tags","blobs_url":"https://api.github.com/repos/graphql-cli/graphql-cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/graphql-cli/graphql-cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/graphql-cli/graphql-cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/graphql-cli/graphql-cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/graphql-cli/graphql-cli/statuses/{sha}","languages_url":"https://api.github.com/repos/graphql-cli/graphql-cli/languages","stargazers_url":"https://api.github.com/repos/graphql-cli/graphql-cli/stargazers","contributors_url":"https://api.github.com/repos/graphql-cli/graphql-cli/contributors","subscribers_url":"https://api.github.com/repos/graphql-cli/graphql-cli/subscribers","subscription_url":"https://api.github.com/repos/graphql-cli/graphql-cli/subscription","commits_url":"https://api.github.com/repos/graphql-cli/graphql-cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/graphql-cli/graphql-cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/graphql-cli/graphql-cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/graphql-cli/graphql-cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/graphql-cli/graphql-cli/contents/{+path}","compare_url":"https://api.github.com/repos/graphql-cli/graphql-cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/graphql-cli/graphql-cli/merges","archive_url":"https://api.github.com/repos/graphql-cli/graphql-cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/graphql-cli/graphql-cli/downloads","issues_url":"https://api.github.com/repos/graphql-cli/graphql-cli/issues{/number}","pulls_url":"https://api.github.com/repos/graphql-cli/graphql-cli/pulls{/number}","milestones_url":"https://api.github.com/repos/graphql-cli/graphql-cli/milestones{/number}","notifications_url":"https://api.github.com/repos/graphql-cli/graphql-cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/graphql-cli/graphql-cli/labels{/name}","releases_url":"https://api.github.com/repos/graphql-cli/graphql-cli/releases{/id}","deployments_url":"https://api.github.com/repos/graphql-cli/graphql-cli/deployments","created_at":"2017-07-17T10:18:56Z","updated_at":"2018-05-31T06:44:54Z","pushed_at":"2018-05-31T12:16:58Z","git_url":"git://github.com/graphql-cli/graphql-cli.git","ssh_url":"git@github.com:graphql-cli/graphql-cli.git","clone_url":"https://github.com/graphql-cli/graphql-cli.git","svn_url":"https://github.com/graphql-cli/graphql-cli","homepage":"","size":1372,"stargazers_count":445,"watchers_count":445,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":43,"mirror_url":null,"archived":false,"open_issues_count":67,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":43,"open_issues":67,"watchers":445,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/graphql-cli/graphql-cli/pulls/311"},"html":{"href":"https://github.com/graphql-cli/graphql-cli/pull/311"},"issue":{"href":"https://api.github.com/repos/graphql-cli/graphql-cli/issues/311"},"comments":{"href":"https://api.github.com/repos/graphql-cli/graphql-cli/issues/311/comments"},"review_comments":{"href":"https://api.github.com/repos/graphql-cli/graphql-cli/pulls/311/comments"},"review_comment":{"href":"https://api.github.com/repos/graphql-cli/graphql-cli/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/graphql-cli/graphql-cli/pulls/311/commits"},"statuses":{"href":"https://api.github.com/repos/graphql-cli/graphql-cli/statuses/a1571620a157c09e7cfcd4437984e09ad7f9c407"}},"author_association":"NONE"}}
{"actor":{"display_login":"marktani"}}