{"action":"created","comment":{"url":"https://api.github.com/repos/graphcool/graphql-yoga/pulls/comments/170286454","pull_request_review_id":98955399,"id":170286454,"diff_hunk":"@@ -53,22 +54,24 @@ export class GraphQLServer {\n     if (props.schema) {\n       this.executableSchema = props.schema\n     } else if (props.typeDefs && props.resolvers) {\n-      let { directiveResolvers, typeDefs, resolvers } = props\n+      let uploadMixin = {}\n+      let { directiveResolvers, resolvers, typeDefs } = props\n+\n+      if (typeof typeDefs === 'string') {\n+        // read from .graphql file if path provided\n+        if (typeDefs.endsWith('graphql')) {\n+          const schemaPath = path.resolve(typeDefs)\n \n-      // read from .graphql file if path provided\n-      if (typeDefs.endsWith('graphql')) {\n-        const schemaPath = path.resolve(typeDefs)\n+          if (!fs.existsSync(schemaPath)) {\n+            throw new Error(`No schema found for path: ${schemaPath}`)\n+          }\n \n-        if (!fs.existsSync(schemaPath)) {\n-          throw new Error(`No schema found for path: ${schemaPath}`)\n+          typeDefs = importSchema(schemaPath)\n         }\n \n-        typeDefs = importSchema(schemaPath)\n+        uploadMixin = typeDefs.includes('scalar Upload') && { Upload: GraphQLUpload }","path":"src/index.ts","position":34,"original_position":34,"commit_id":"a0e21ad08af595cd680cb8a753cae4d8c5ea0682","original_commit_id":"a0e21ad08af595cd680cb8a753cae4d8c5ea0682","user":{"login":"schickling","id":1567498,"avatar_url":"https://avatars2.githubusercontent.com/u/1567498?v=4","gravatar_id":"","url":"https://api.github.com/users/schickling","html_url":"https://github.com/schickling","followers_url":"https://api.github.com/users/schickling/followers","following_url":"https://api.github.com/users/schickling/following{/other_user}","gists_url":"https://api.github.com/users/schickling/gists{/gist_id}","starred_url":"https://api.github.com/users/schickling/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schickling/subscriptions","organizations_url":"https://api.github.com/users/schickling/orgs","repos_url":"https://api.github.com/users/schickling/repos","events_url":"https://api.github.com/users/schickling/events{/privacy}","received_events_url":"https://api.github.com/users/schickling/received_events","type":"User","site_admin":false},"body":"Yeah, I like that better!","created_at":"2018-02-23T15:48:10Z","updated_at":"2018-02-23T15:48:10Z","html_url":"https://github.com/graphcool/graphql-yoga/pull/187#discussion_r170286454","pull_request_url":"https://api.github.com/repos/graphcool/graphql-yoga/pulls/187","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/graphcool/graphql-yoga/pulls/comments/170286454"},"html":{"href":"https://github.com/graphcool/graphql-yoga/pull/187#discussion_r170286454"},"pull_request":{"href":"https://api.github.com/repos/graphcool/graphql-yoga/pulls/187"}},"in_reply_to_id":170256064},"pull_request":{"url":"https://api.github.com/repos/graphcool/graphql-yoga/pulls/187","id":170994356,"html_url":"https://github.com/graphcool/graphql-yoga/pull/187","diff_url":"https://github.com/graphcool/graphql-yoga/pull/187.diff","patch_url":"https://github.com/graphcool/graphql-yoga/pull/187.patch","issue_url":"https://api.github.com/repos/graphcool/graphql-yoga/issues/187","number":187,"state":"open","locked":false,"title":"feat: suport array syntax for typeDefs argument","user":{"login":"eduardomoroni","id":823150,"avatar_url":"https://avatars1.githubusercontent.com/u/823150?v=4","gravatar_id":"","url":"https://api.github.com/users/eduardomoroni","html_url":"https://github.com/eduardomoroni","followers_url":"https://api.github.com/users/eduardomoroni/followers","following_url":"https://api.github.com/users/eduardomoroni/following{/other_user}","gists_url":"https://api.github.com/users/eduardomoroni/gists{/gist_id}","starred_url":"https://api.github.com/users/eduardomoroni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eduardomoroni/subscriptions","organizations_url":"https://api.github.com/users/eduardomoroni/orgs","repos_url":"https://api.github.com/users/eduardomoroni/repos","events_url":"https://api.github.com/users/eduardomoroni/events{/privacy}","received_events_url":"https://api.github.com/users/eduardomoroni/received_events","type":"User","site_admin":false},"body":"This PR fixes: https://github.com/graphcool/graphql-yoga/issues/185.\r\nAdopt `ITypeDefinitions` from `graphql-tools` for typeDefs type.\r\nType check before trying to verify if typeDefs is a string containing a path to import `graphql.schema`","created_at":"2018-02-23T11:37:06Z","updated_at":"2018-02-23T15:48:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"257a013175a084ea07756f802ae5abef9dbba4b5","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/graphcool/graphql-yoga/pulls/187/commits","review_comments_url":"https://api.github.com/repos/graphcool/graphql-yoga/pulls/187/comments","review_comment_url":"https://api.github.com/repos/graphcool/graphql-yoga/pulls/comments{/number}","comments_url":"https://api.github.com/repos/graphcool/graphql-yoga/issues/187/comments","statuses_url":"https://api.github.com/repos/graphcool/graphql-yoga/statuses/a0e21ad08af595cd680cb8a753cae4d8c5ea0682","head":{"label":"eduardomoroni:master","ref":"master","sha":"a0e21ad08af595cd680cb8a753cae4d8c5ea0682","user":{"login":"eduardomoroni","id":823150,"avatar_url":"https://avatars1.githubusercontent.com/u/823150?v=4","gravatar_id":"","url":"https://api.github.com/users/eduardomoroni","html_url":"https://github.com/eduardomoroni","followers_url":"https://api.github.com/users/eduardomoroni/followers","following_url":"https://api.github.com/users/eduardomoroni/following{/other_user}","gists_url":"https://api.github.com/users/eduardomoroni/gists{/gist_id}","starred_url":"https://api.github.com/users/eduardomoroni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eduardomoroni/subscriptions","organizations_url":"https://api.github.com/users/eduardomoroni/orgs","repos_url":"https://api.github.com/users/eduardomoroni/repos","events_url":"https://api.github.com/users/eduardomoroni/events{/privacy}","received_events_url":"https://api.github.com/users/eduardomoroni/received_events","type":"User","site_admin":false},"repo":{"id":122497041,"name":"graphql-yoga","full_name":"eduardomoroni/graphql-yoga","owner":{"login":"eduardomoroni","id":823150,"avatar_url":"https://avatars1.githubusercontent.com/u/823150?v=4","gravatar_id":"","url":"https://api.github.com/users/eduardomoroni","html_url":"https://github.com/eduardomoroni","followers_url":"https://api.github.com/users/eduardomoroni/followers","following_url":"https://api.github.com/users/eduardomoroni/following{/other_user}","gists_url":"https://api.github.com/users/eduardomoroni/gists{/gist_id}","starred_url":"https://api.github.com/users/eduardomoroni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eduardomoroni/subscriptions","organizations_url":"https://api.github.com/users/eduardomoroni/orgs","repos_url":"https://api.github.com/users/eduardomoroni/repos","events_url":"https://api.github.com/users/eduardomoroni/events{/privacy}","received_events_url":"https://api.github.com/users/eduardomoroni/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/eduardomoroni/graphql-yoga","description":"🧘 Fully-featured GraphQL Server with focus on easy setup, performance & great developer experience","fork":true,"url":"https://api.github.com/repos/eduardomoroni/graphql-yoga","forks_url":"https://api.github.com/repos/eduardomoroni/graphql-yoga/forks","keys_url":"https://api.github.com/repos/eduardomoroni/graphql-yoga/keys{/key_id}","collaborators_url":"https://api.github.com/repos/eduardomoroni/graphql-yoga/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/eduardomoroni/graphql-yoga/teams","hooks_url":"https://api.github.com/repos/eduardomoroni/graphql-yoga/hooks","issue_events_url":"https://api.github.com/repos/eduardomoroni/graphql-yoga/issues/events{/number}","events_url":"https://api.github.com/repos/eduardomoroni/graphql-yoga/events","assignees_url":"https://api.github.com/repos/eduardomoroni/graphql-yoga/assignees{/user}","branches_url":"https://api.github.com/repos/eduardomoroni/graphql-yoga/branches{/branch}","tags_url":"https://api.github.com/repos/eduardomoroni/graphql-yoga/tags","blobs_url":"https://api.github.com/repos/eduardomoroni/graphql-yoga/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/eduardomoroni/graphql-yoga/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/eduardomoroni/graphql-yoga/git/refs{/sha}","trees_url":"https://api.github.com/repos/eduardomoroni/graphql-yoga/git/trees{/sha}","statuses_url":"https://api.github.com/repos/eduardomoroni/graphql-yoga/statuses/{sha}","languages_url":"https://api.github.com/repos/eduardomoroni/graphql-yoga/languages","stargazers_url":"https://api.github.com/repos/eduardomoroni/graphql-yoga/stargazers","contributors_url":"https://api.github.com/repos/eduardomoroni/graphql-yoga/contributors","subscribers_url":"https://api.github.com/repos/eduardomoroni/graphql-yoga/subscribers","subscription_url":"https://api.github.com/repos/eduardomoroni/graphql-yoga/subscription","commits_url":"https://api.github.com/repos/eduardomoroni/graphql-yoga/commits{/sha}","git_commits_url":"https://api.github.com/repos/eduardomoroni/graphql-yoga/git/commits{/sha}","comments_url":"https://api.github.com/repos/eduardomoroni/graphql-yoga/comments{/number}","issue_comment_url":"https://api.github.com/repos/eduardomoroni/graphql-yoga/issues/comments{/number}","contents_url":"https://api.github.com/repos/eduardomoroni/graphql-yoga/contents/{+path}","compare_url":"https://api.github.com/repos/eduardomoroni/graphql-yoga/compare/{base}...{head}","merges_url":"https://api.github.com/repos/eduardomoroni/graphql-yoga/merges","archive_url":"https://api.github.com/repos/eduardomoroni/graphql-yoga/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/eduardomoroni/graphql-yoga/downloads","issues_url":"https://api.github.com/repos/eduardomoroni/graphql-yoga/issues{/number}","pulls_url":"https://api.github.com/repos/eduardomoroni/graphql-yoga/pulls{/number}","milestones_url":"https://api.github.com/repos/eduardomoroni/graphql-yoga/milestones{/number}","notifications_url":"https://api.github.com/repos/eduardomoroni/graphql-yoga/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/eduardomoroni/graphql-yoga/labels{/name}","releases_url":"https://api.github.com/repos/eduardomoroni/graphql-yoga/releases{/id}","deployments_url":"https://api.github.com/repos/eduardomoroni/graphql-yoga/deployments","created_at":"2018-02-22T15:26:20Z","updated_at":"2018-02-22T15:26:22Z","pushed_at":"2018-02-23T11:38:30Z","git_url":"git://github.com/eduardomoroni/graphql-yoga.git","ssh_url":"git@github.com:eduardomoroni/graphql-yoga.git","clone_url":"https://github.com/eduardomoroni/graphql-yoga.git","svn_url":"https://github.com/eduardomoroni/graphql-yoga","homepage":"","size":539,"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"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"graphcool:master","ref":"master","sha":"f9353eab00e9270e39030bb9b1dc93f2a36b7f9a","user":{"login":"graphcool","id":17219288,"avatar_url":"https://avatars0.githubusercontent.com/u/17219288?v=4","gravatar_id":"","url":"https://api.github.com/users/graphcool","html_url":"https://github.com/graphcool","followers_url":"https://api.github.com/users/graphcool/followers","following_url":"https://api.github.com/users/graphcool/following{/other_user}","gists_url":"https://api.github.com/users/graphcool/gists{/gist_id}","starred_url":"https://api.github.com/users/graphcool/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/graphcool/subscriptions","organizations_url":"https://api.github.com/users/graphcool/orgs","repos_url":"https://api.github.com/users/graphcool/repos","events_url":"https://api.github.com/users/graphcool/events{/privacy}","received_events_url":"https://api.github.com/users/graphcool/received_events","type":"Organization","site_admin":false},"repo":{"id":110819939,"name":"graphql-yoga","full_name":"graphcool/graphql-yoga","owner":{"login":"graphcool","id":17219288,"avatar_url":"https://avatars0.githubusercontent.com/u/17219288?v=4","gravatar_id":"","url":"https://api.github.com/users/graphcool","html_url":"https://github.com/graphcool","followers_url":"https://api.github.com/users/graphcool/followers","following_url":"https://api.github.com/users/graphcool/following{/other_user}","gists_url":"https://api.github.com/users/graphcool/gists{/gist_id}","starred_url":"https://api.github.com/users/graphcool/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/graphcool/subscriptions","organizations_url":"https://api.github.com/users/graphcool/orgs","repos_url":"https://api.github.com/users/graphcool/repos","events_url":"https://api.github.com/users/graphcool/events{/privacy}","received_events_url":"https://api.github.com/users/graphcool/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/graphcool/graphql-yoga","description":"🧘 Fully-featured GraphQL Server with focus on easy setup, performance & great developer experience","fork":false,"url":"https://api.github.com/repos/graphcool/graphql-yoga","forks_url":"https://api.github.com/repos/graphcool/graphql-yoga/forks","keys_url":"https://api.github.com/repos/graphcool/graphql-yoga/keys{/key_id}","collaborators_url":"https://api.github.com/repos/graphcool/graphql-yoga/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/graphcool/graphql-yoga/teams","hooks_url":"https://api.github.com/repos/graphcool/graphql-yoga/hooks","issue_events_url":"https://api.github.com/repos/graphcool/graphql-yoga/issues/events{/number}","events_url":"https://api.github.com/repos/graphcool/graphql-yoga/events","assignees_url":"https://api.github.com/repos/graphcool/graphql-yoga/assignees{/user}","branches_url":"https://api.github.com/repos/graphcool/graphql-yoga/branches{/branch}","tags_url":"https://api.github.com/repos/graphcool/graphql-yoga/tags","blobs_url":"https://api.github.com/repos/graphcool/graphql-yoga/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/graphcool/graphql-yoga/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/graphcool/graphql-yoga/git/refs{/sha}","trees_url":"https://api.github.com/repos/graphcool/graphql-yoga/git/trees{/sha}","statuses_url":"https://api.github.com/repos/graphcool/graphql-yoga/statuses/{sha}","languages_url":"https://api.github.com/repos/graphcool/graphql-yoga/languages","stargazers_url":"https://api.github.com/repos/graphcool/graphql-yoga/stargazers","contributors_url":"https://api.github.com/repos/graphcool/graphql-yoga/contributors","subscribers_url":"https://api.github.com/repos/graphcool/graphql-yoga/subscribers","subscription_url":"https://api.github.com/repos/graphcool/graphql-yoga/subscription","commits_url":"https://api.github.com/repos/graphcool/graphql-yoga/commits{/sha}","git_commits_url":"https://api.github.com/repos/graphcool/graphql-yoga/git/commits{/sha}","comments_url":"https://api.github.com/repos/graphcool/graphql-yoga/comments{/number}","issue_comment_url":"https://api.github.com/repos/graphcool/graphql-yoga/issues/comments{/number}","contents_url":"https://api.github.com/repos/graphcool/graphql-yoga/contents/{+path}","compare_url":"https://api.github.com/repos/graphcool/graphql-yoga/compare/{base}...{head}","merges_url":"https://api.github.com/repos/graphcool/graphql-yoga/merges","archive_url":"https://api.github.com/repos/graphcool/graphql-yoga/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/graphcool/graphql-yoga/downloads","issues_url":"https://api.github.com/repos/graphcool/graphql-yoga/issues{/number}","pulls_url":"https://api.github.com/repos/graphcool/graphql-yoga/pulls{/number}","milestones_url":"https://api.github.com/repos/graphcool/graphql-yoga/milestones{/number}","notifications_url":"https://api.github.com/repos/graphcool/graphql-yoga/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/graphcool/graphql-yoga/labels{/name}","releases_url":"https://api.github.com/repos/graphcool/graphql-yoga/releases{/id}","deployments_url":"https://api.github.com/repos/graphcool/graphql-yoga/deployments","created_at":"2017-11-15T10:35:08Z","updated_at":"2018-02-23T15:13:36Z","pushed_at":"2018-02-23T15:27:19Z","git_url":"git://github.com/graphcool/graphql-yoga.git","ssh_url":"git@github.com:graphcool/graphql-yoga.git","clone_url":"https://github.com/graphcool/graphql-yoga.git","svn_url":"https://github.com/graphcool/graphql-yoga","homepage":"","size":535,"stargazers_count":795,"watchers_count":795,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":48,"mirror_url":null,"archived":false,"open_issues_count":30,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":48,"open_issues":30,"watchers":795,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/graphcool/graphql-yoga/pulls/187"},"html":{"href":"https://github.com/graphcool/graphql-yoga/pull/187"},"issue":{"href":"https://api.github.com/repos/graphcool/graphql-yoga/issues/187"},"comments":{"href":"https://api.github.com/repos/graphcool/graphql-yoga/issues/187/comments"},"review_comments":{"href":"https://api.github.com/repos/graphcool/graphql-yoga/pulls/187/comments"},"review_comment":{"href":"https://api.github.com/repos/graphcool/graphql-yoga/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/graphcool/graphql-yoga/pulls/187/commits"},"statuses":{"href":"https://api.github.com/repos/graphcool/graphql-yoga/statuses/a0e21ad08af595cd680cb8a753cae4d8c5ea0682"}},"author_association":"NONE"}}
{"actor":{"display_login":"schickling"}}