{"action":"created","comment":{"url":"https://api.github.com/repos/vektah/gqlparser/pulls/comments/232939770","pull_request_review_id":174243650,"id":232939770,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzMjkzOTc3MA==","diff_hunk":"@@ -29,42 +29,96 @@ func TestParserUtils(t *testing.T) {\n \t\trequire.Nil(t, p.err)\n \t})\n \n-\tt.Run(\"test many can read array\", func(t *testing.T) {\n-\t\tp := newParser(\"[a b c d]\")\n+\tt.Run(\"test many\", func(t *testing.T) {\n+\t\tt.Run(\"can read array\", func(t *testing.T) {\n+\t\t\tp := newParser(\"[a b c d]\")\n+\n+\t\t\tvar arr []string\n+\t\t\tp.many(lexer.BracketL, lexer.BracketR, func() {\n+\t\t\t\tarr = append(arr, p.next().Value)\n+\t\t\t})\n+\t\t\trequire.Nil(t, p.err)\n+\t\t\trequire.Equal(t, []string{\"a\", \"b\", \"c\", \"d\"}, arr)\n+\n+\t\t\trequire.Equal(t, lexer.EOF, p.peek().Kind)\n+\t\t\trequire.Nil(t, p.err)\n+\t\t})\n+\n+\t\tt.Run(\"return if open is not found\", func(t *testing.T) {\n+\t\t\tp := newParser(\"turtles are happy\")\n \n-\t\tvar arr []string\n-\t\tp.many(lexer.BracketL, lexer.BracketR, func() {\n-\t\t\tarr = append(arr, p.next().Value)\n+\t\t\tp.many(lexer.BracketL, lexer.BracketR, func() {\n+\t\t\t\tt.Error(\"cb should not be called\")\n+\t\t\t})\n+\t\t\trequire.Nil(t, p.err)\n+\t\t\trequire.Equal(t, \"turtles\", p.next().Value)\n \t\t})\n-\t\trequire.Nil(t, p.err)\n-\t\trequire.Equal(t, []string{\"a\", \"b\", \"c\", \"d\"}, arr)\n \n-\t\trequire.Equal(t, lexer.EOF, p.peek().Kind)\n-\t\trequire.Nil(t, p.err)\n+\t\tt.Run(\"will stop on error\", func(t *testing.T) {\n+\t\t\tp := newParser(\"[a b c d]\")\n+\n+\t\t\tvar arr []string\n+\t\t\tp.many(lexer.BracketL, lexer.BracketR, func() {\n+\t\t\t\tarr = append(arr, p.next().Value)\n+\t\t\t\tif len(arr) == 2 {\n+\t\t\t\t\tp.error(p.peek(), \"boom\")\n+\t\t\t\t}\n+\t\t\t})\n+\t\t\trequire.EqualError(t, p.err, \"input.graphql:1: boom\")\n+\t\t\trequire.Equal(t, []string{\"a\", \"b\"}, arr)\n+\t\t})\n \t})\n \n-\tt.Run(\"test many return if open is not found\", func(t *testing.T) {\n-\t\tp := newParser(\"turtles are happy\")\n+\tt.Run(\"test some\", func(t *testing.T) {\n+\t\tt.Run(\"can read array\", func(t *testing.T) {\n+\t\t\tp := newParser(\"[a b c d]\")\n+\n+\t\t\tvar arr []string\n+\t\t\tp.some(lexer.BracketL, lexer.BracketR, func() {\n+\t\t\t\tarr = append(arr, p.next().Value)\n+\t\t\t})\n+\t\t\trequire.Nil(t, p.err)\n+\t\t\trequire.Equal(t, []string{\"a\", \"b\", \"c\", \"d\"}, arr)\n \n-\t\tp.many(lexer.BracketL, lexer.BracketR, func() {\n-\t\t\tt.Error(\"cb should not be called\")\n+\t\t\trequire.Equal(t, lexer.EOF, p.peek().Kind)\n+\t\t\trequire.Nil(t, p.err)\n \t\t})\n-\t\trequire.Nil(t, p.err)\n-\t\trequire.Equal(t, \"turtles\", p.next().Value)\n-\t})\n \n-\tt.Run(\"test many will stop on error\", func(t *testing.T) {\n-\t\tp := newParser(\"[a b c d]\")\n+\t\tt.Run(\"can't read empty array\", func(t *testing.T) {\n+\t\t\tp := newParser(\"[]\")\n+\n+\t\t\tvar arr []string\n+\t\t\tp.some(lexer.BracketL, lexer.BracketR, func() {\n+\t\t\t\tarr = append(arr, p.next().Value)\n+\t\t\t})\n+\t\t\trequire.EqualError(t, p.err, \"input.graphql:1: expected at least one definition, found ]\")\n+\t\t\trequire.Equal(t, []string(nil), arr)\n+\t\t\trequire.NotEqual(t, lexer.EOF, p.peek().Kind)\n+\t\t})\n+\n+\t\tt.Run(\"return if open is not found\", func(t *testing.T) {\n+\t\t\tp := newParser(\"turtles are happy\")\n+\n+\t\t\tp.some(lexer.BracketL, lexer.BracketR, func() {\n+\t\t\t\tt.Error(\"cb should not be called\")\n+\t\t\t})\n+\t\t\trequire.Nil(t, p.err)","path":"parser/parser_test.go","position":95,"original_position":95,"commit_id":"9bba2f27a5aaa17dc4bccf6eaa1ba4b545812c17","original_commit_id":"9bba2f27a5aaa17dc4bccf6eaa1ba4b545812c17","user":{"login":"vvakame","id":125332,"node_id":"MDQ6VXNlcjEyNTMzMg==","avatar_url":"https://avatars0.githubusercontent.com/u/125332?v=4","gravatar_id":"","url":"https://api.github.com/users/vvakame","html_url":"https://github.com/vvakame","followers_url":"https://api.github.com/users/vvakame/followers","following_url":"https://api.github.com/users/vvakame/following{/other_user}","gists_url":"https://api.github.com/users/vvakame/gists{/gist_id}","starred_url":"https://api.github.com/users/vvakame/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vvakame/subscriptions","organizations_url":"https://api.github.com/users/vvakame/orgs","repos_url":"https://api.github.com/users/vvakame/repos","events_url":"https://api.github.com/users/vvakame/events{/privacy}","received_events_url":"https://api.github.com/users/vvakame/received_events","type":"User","site_admin":false},"body":"`some` method has below code.\r\n```\r\n\thasDef := p.skip(start)\r\n\tif !hasDef {\r\n\t\treturn\r\n\t}\r\n```\r\n\r\nWe should consume `type Foo @bar` but `type Foo {}` is not.\r\n","created_at":"2018-11-13T08:43:01Z","updated_at":"2018-11-13T08:43:02Z","html_url":"https://github.com/vektah/gqlparser/pull/71#discussion_r232939770","pull_request_url":"https://api.github.com/repos/vektah/gqlparser/pulls/71","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/vektah/gqlparser/pulls/comments/232939770"},"html":{"href":"https://github.com/vektah/gqlparser/pull/71#discussion_r232939770"},"pull_request":{"href":"https://api.github.com/repos/vektah/gqlparser/pulls/71"}},"in_reply_to_id":232937042},"pull_request":{"url":"https://api.github.com/repos/vektah/gqlparser/pulls/71","id":230377725,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMwMzc3NzI1","html_url":"https://github.com/vektah/gqlparser/pull/71","diff_url":"https://github.com/vektah/gqlparser/pull/71.diff","patch_url":"https://github.com/vektah/gqlparser/pull/71.patch","issue_url":"https://api.github.com/repos/vektah/gqlparser/issues/71","number":71,"state":"open","locked":false,"title":"validate Object/Input Object/Enum/Interface must define one or more f…","user":{"login":"vvakame","id":125332,"node_id":"MDQ6VXNlcjEyNTMzMg==","avatar_url":"https://avatars0.githubusercontent.com/u/125332?v=4","gravatar_id":"","url":"https://api.github.com/users/vvakame","html_url":"https://github.com/vvakame","followers_url":"https://api.github.com/users/vvakame/followers","following_url":"https://api.github.com/users/vvakame/following{/other_user}","gists_url":"https://api.github.com/users/vvakame/gists{/gist_id}","starred_url":"https://api.github.com/users/vvakame/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vvakame/subscriptions","organizations_url":"https://api.github.com/users/vvakame/orgs","repos_url":"https://api.github.com/users/vvakame/repos","events_url":"https://api.github.com/users/vvakame/events{/privacy}","received_events_url":"https://api.github.com/users/vvakame/received_events","type":"User","site_admin":false},"body":"…ields\r\n\r\nfixes https://github.com/99designs/gqlgen/issues/423\r\ncloses https://github.com/99designs/gqlgen/pull/428\r\n","created_at":"2018-11-13T07:50:28Z","updated_at":"2018-11-13T08:43:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3851ea0813b3b82bb38d1b7f999cf6d8bb65a276","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/vektah/gqlparser/pulls/71/commits","review_comments_url":"https://api.github.com/repos/vektah/gqlparser/pulls/71/comments","review_comment_url":"https://api.github.com/repos/vektah/gqlparser/pulls/comments{/number}","comments_url":"https://api.github.com/repos/vektah/gqlparser/issues/71/comments","statuses_url":"https://api.github.com/repos/vektah/gqlparser/statuses/9bba2f27a5aaa17dc4bccf6eaa1ba4b545812c17","head":{"label":"vektah:feat-empty-validate","ref":"feat-empty-validate","sha":"9bba2f27a5aaa17dc4bccf6eaa1ba4b545812c17","user":{"login":"vektah","id":2247982,"node_id":"MDQ6VXNlcjIyNDc5ODI=","avatar_url":"https://avatars0.githubusercontent.com/u/2247982?v=4","gravatar_id":"","url":"https://api.github.com/users/vektah","html_url":"https://github.com/vektah","followers_url":"https://api.github.com/users/vektah/followers","following_url":"https://api.github.com/users/vektah/following{/other_user}","gists_url":"https://api.github.com/users/vektah/gists{/gist_id}","starred_url":"https://api.github.com/users/vektah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vektah/subscriptions","organizations_url":"https://api.github.com/users/vektah/orgs","repos_url":"https://api.github.com/users/vektah/repos","events_url":"https://api.github.com/users/vektah/events{/privacy}","received_events_url":"https://api.github.com/users/vektah/received_events","type":"User","site_admin":false},"repo":{"id":132299984,"node_id":"MDEwOlJlcG9zaXRvcnkxMzIyOTk5ODQ=","name":"gqlparser","full_name":"vektah/gqlparser","private":false,"owner":{"login":"vektah","id":2247982,"node_id":"MDQ6VXNlcjIyNDc5ODI=","avatar_url":"https://avatars0.githubusercontent.com/u/2247982?v=4","gravatar_id":"","url":"https://api.github.com/users/vektah","html_url":"https://github.com/vektah","followers_url":"https://api.github.com/users/vektah/followers","following_url":"https://api.github.com/users/vektah/following{/other_user}","gists_url":"https://api.github.com/users/vektah/gists{/gist_id}","starred_url":"https://api.github.com/users/vektah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vektah/subscriptions","organizations_url":"https://api.github.com/users/vektah/orgs","repos_url":"https://api.github.com/users/vektah/repos","events_url":"https://api.github.com/users/vektah/events{/privacy}","received_events_url":"https://api.github.com/users/vektah/received_events","type":"User","site_admin":false},"html_url":"https://github.com/vektah/gqlparser","description":"A port of the parser from graphql-js into golang","fork":false,"url":"https://api.github.com/repos/vektah/gqlparser","forks_url":"https://api.github.com/repos/vektah/gqlparser/forks","keys_url":"https://api.github.com/repos/vektah/gqlparser/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vektah/gqlparser/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vektah/gqlparser/teams","hooks_url":"https://api.github.com/repos/vektah/gqlparser/hooks","issue_events_url":"https://api.github.com/repos/vektah/gqlparser/issues/events{/number}","events_url":"https://api.github.com/repos/vektah/gqlparser/events","assignees_url":"https://api.github.com/repos/vektah/gqlparser/assignees{/user}","branches_url":"https://api.github.com/repos/vektah/gqlparser/branches{/branch}","tags_url":"https://api.github.com/repos/vektah/gqlparser/tags","blobs_url":"https://api.github.com/repos/vektah/gqlparser/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vektah/gqlparser/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vektah/gqlparser/git/refs{/sha}","trees_url":"https://api.github.com/repos/vektah/gqlparser/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vektah/gqlparser/statuses/{sha}","languages_url":"https://api.github.com/repos/vektah/gqlparser/languages","stargazers_url":"https://api.github.com/repos/vektah/gqlparser/stargazers","contributors_url":"https://api.github.com/repos/vektah/gqlparser/contributors","subscribers_url":"https://api.github.com/repos/vektah/gqlparser/subscribers","subscription_url":"https://api.github.com/repos/vektah/gqlparser/subscription","commits_url":"https://api.github.com/repos/vektah/gqlparser/commits{/sha}","git_commits_url":"https://api.github.com/repos/vektah/gqlparser/git/commits{/sha}","comments_url":"https://api.github.com/repos/vektah/gqlparser/comments{/number}","issue_comment_url":"https://api.github.com/repos/vektah/gqlparser/issues/comments{/number}","contents_url":"https://api.github.com/repos/vektah/gqlparser/contents/{+path}","compare_url":"https://api.github.com/repos/vektah/gqlparser/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vektah/gqlparser/merges","archive_url":"https://api.github.com/repos/vektah/gqlparser/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vektah/gqlparser/downloads","issues_url":"https://api.github.com/repos/vektah/gqlparser/issues{/number}","pulls_url":"https://api.github.com/repos/vektah/gqlparser/pulls{/number}","milestones_url":"https://api.github.com/repos/vektah/gqlparser/milestones{/number}","notifications_url":"https://api.github.com/repos/vektah/gqlparser/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vektah/gqlparser/labels{/name}","releases_url":"https://api.github.com/repos/vektah/gqlparser/releases{/id}","deployments_url":"https://api.github.com/repos/vektah/gqlparser/deployments","created_at":"2018-05-06T02:24:25Z","updated_at":"2018-11-08T21:43:53Z","pushed_at":"2018-11-13T08:24:57Z","git_url":"git://github.com/vektah/gqlparser.git","ssh_url":"git@github.com:vektah/gqlparser.git","clone_url":"https://github.com/vektah/gqlparser.git","svn_url":"https://github.com/vektah/gqlparser","homepage":null,"size":336,"stargazers_count":97,"watchers_count":97,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":14,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":14,"open_issues":1,"watchers":97,"default_branch":"master"}},"base":{"label":"vektah:master","ref":"master","sha":"07406bbdde4196e396e2f40c24defe84e9243ad5","user":{"login":"vektah","id":2247982,"node_id":"MDQ6VXNlcjIyNDc5ODI=","avatar_url":"https://avatars0.githubusercontent.com/u/2247982?v=4","gravatar_id":"","url":"https://api.github.com/users/vektah","html_url":"https://github.com/vektah","followers_url":"https://api.github.com/users/vektah/followers","following_url":"https://api.github.com/users/vektah/following{/other_user}","gists_url":"https://api.github.com/users/vektah/gists{/gist_id}","starred_url":"https://api.github.com/users/vektah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vektah/subscriptions","organizations_url":"https://api.github.com/users/vektah/orgs","repos_url":"https://api.github.com/users/vektah/repos","events_url":"https://api.github.com/users/vektah/events{/privacy}","received_events_url":"https://api.github.com/users/vektah/received_events","type":"User","site_admin":false},"repo":{"id":132299984,"node_id":"MDEwOlJlcG9zaXRvcnkxMzIyOTk5ODQ=","name":"gqlparser","full_name":"vektah/gqlparser","private":false,"owner":{"login":"vektah","id":2247982,"node_id":"MDQ6VXNlcjIyNDc5ODI=","avatar_url":"https://avatars0.githubusercontent.com/u/2247982?v=4","gravatar_id":"","url":"https://api.github.com/users/vektah","html_url":"https://github.com/vektah","followers_url":"https://api.github.com/users/vektah/followers","following_url":"https://api.github.com/users/vektah/following{/other_user}","gists_url":"https://api.github.com/users/vektah/gists{/gist_id}","starred_url":"https://api.github.com/users/vektah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vektah/subscriptions","organizations_url":"https://api.github.com/users/vektah/orgs","repos_url":"https://api.github.com/users/vektah/repos","events_url":"https://api.github.com/users/vektah/events{/privacy}","received_events_url":"https://api.github.com/users/vektah/received_events","type":"User","site_admin":false},"html_url":"https://github.com/vektah/gqlparser","description":"A port of the parser from graphql-js into golang","fork":false,"url":"https://api.github.com/repos/vektah/gqlparser","forks_url":"https://api.github.com/repos/vektah/gqlparser/forks","keys_url":"https://api.github.com/repos/vektah/gqlparser/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vektah/gqlparser/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vektah/gqlparser/teams","hooks_url":"https://api.github.com/repos/vektah/gqlparser/hooks","issue_events_url":"https://api.github.com/repos/vektah/gqlparser/issues/events{/number}","events_url":"https://api.github.com/repos/vektah/gqlparser/events","assignees_url":"https://api.github.com/repos/vektah/gqlparser/assignees{/user}","branches_url":"https://api.github.com/repos/vektah/gqlparser/branches{/branch}","tags_url":"https://api.github.com/repos/vektah/gqlparser/tags","blobs_url":"https://api.github.com/repos/vektah/gqlparser/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vektah/gqlparser/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vektah/gqlparser/git/refs{/sha}","trees_url":"https://api.github.com/repos/vektah/gqlparser/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vektah/gqlparser/statuses/{sha}","languages_url":"https://api.github.com/repos/vektah/gqlparser/languages","stargazers_url":"https://api.github.com/repos/vektah/gqlparser/stargazers","contributors_url":"https://api.github.com/repos/vektah/gqlparser/contributors","subscribers_url":"https://api.github.com/repos/vektah/gqlparser/subscribers","subscription_url":"https://api.github.com/repos/vektah/gqlparser/subscription","commits_url":"https://api.github.com/repos/vektah/gqlparser/commits{/sha}","git_commits_url":"https://api.github.com/repos/vektah/gqlparser/git/commits{/sha}","comments_url":"https://api.github.com/repos/vektah/gqlparser/comments{/number}","issue_comment_url":"https://api.github.com/repos/vektah/gqlparser/issues/comments{/number}","contents_url":"https://api.github.com/repos/vektah/gqlparser/contents/{+path}","compare_url":"https://api.github.com/repos/vektah/gqlparser/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vektah/gqlparser/merges","archive_url":"https://api.github.com/repos/vektah/gqlparser/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vektah/gqlparser/downloads","issues_url":"https://api.github.com/repos/vektah/gqlparser/issues{/number}","pulls_url":"https://api.github.com/repos/vektah/gqlparser/pulls{/number}","milestones_url":"https://api.github.com/repos/vektah/gqlparser/milestones{/number}","notifications_url":"https://api.github.com/repos/vektah/gqlparser/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vektah/gqlparser/labels{/name}","releases_url":"https://api.github.com/repos/vektah/gqlparser/releases{/id}","deployments_url":"https://api.github.com/repos/vektah/gqlparser/deployments","created_at":"2018-05-06T02:24:25Z","updated_at":"2018-11-08T21:43:53Z","pushed_at":"2018-11-13T08:24:57Z","git_url":"git://github.com/vektah/gqlparser.git","ssh_url":"git@github.com:vektah/gqlparser.git","clone_url":"https://github.com/vektah/gqlparser.git","svn_url":"https://github.com/vektah/gqlparser","homepage":null,"size":336,"stargazers_count":97,"watchers_count":97,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":14,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":14,"open_issues":1,"watchers":97,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/vektah/gqlparser/pulls/71"},"html":{"href":"https://github.com/vektah/gqlparser/pull/71"},"issue":{"href":"https://api.github.com/repos/vektah/gqlparser/issues/71"},"comments":{"href":"https://api.github.com/repos/vektah/gqlparser/issues/71/comments"},"review_comments":{"href":"https://api.github.com/repos/vektah/gqlparser/pulls/71/comments"},"review_comment":{"href":"https://api.github.com/repos/vektah/gqlparser/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/vektah/gqlparser/pulls/71/commits"},"statuses":{"href":"https://api.github.com/repos/vektah/gqlparser/statuses/9bba2f27a5aaa17dc4bccf6eaa1ba4b545812c17"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"vvakame"}}