{"action":"opened","number":173,"pull_request":{"url":"https://api.github.com/repos/graphql-go/graphql/pulls/173","id":95807263,"html_url":"https://github.com/graphql-go/graphql/pull/173","diff_url":"https://github.com/graphql-go/graphql/pull/173.diff","patch_url":"https://github.com/graphql-go/graphql/pull/173.patch","issue_url":"https://api.github.com/repos/graphql-go/graphql/issues/173","number":173,"state":"open","locked":false,"title":"executor: add `graphql` tag","user":{"login":"chris-ramon","id":1000404,"avatar_url":"https://avatars.githubusercontent.com/u/1000404?v=3","gravatar_id":"","url":"https://api.github.com/users/chris-ramon","html_url":"https://github.com/chris-ramon","followers_url":"https://api.github.com/users/chris-ramon/followers","following_url":"https://api.github.com/users/chris-ramon/following{/other_user}","gists_url":"https://api.github.com/users/chris-ramon/gists{/gist_id}","starred_url":"https://api.github.com/users/chris-ramon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chris-ramon/subscriptions","organizations_url":"https://api.github.com/users/chris-ramon/orgs","repos_url":"https://api.github.com/users/chris-ramon/repos","events_url":"https://api.github.com/users/chris-ramon/events{/privacy}","received_events_url":"https://api.github.com/users/chris-ramon/received_events","type":"User","site_admin":false},"body":"#### Overview\r\nThis changes adds support for optional `graphql` tags on structs.\r\n\r\nFor example if we have a struct:\r\n```go\r\ntype Baz struct {\r\n  FooBar string\r\n}\r\n```\r\n\r\nAnd an object type:\r\n```go\r\ntypeObjectType := graphql.NewObject(graphql.ObjectConfig{\r\n  Name: \"Type\",\r\n  Fields: graphql.Fields{\r\n    \"fooBar\": &graphql.Field{Type: graphql.String},\r\n  },\r\n})\r\n```\r\n\r\nAnd a resolve function:\r\n```go\r\nResolve: func(p graphql.ResolveParams) (interface{}, error) {\r\n  t := struct {\r\n    FooBar string\r\n  }{\"foo bar value\"}\r\n  return t, nil\r\n},\r\n```\r\n\r\nField `FooBar` won't have the desired value `foo bar value` due to `FooBar` does not match the field name `fooBar` from `typeObjectType`.\r\n\r\n#### Solution\r\nIs to use `graphql` tags on structs, like the following:\r\n\r\n```go\r\nResolve: func(p graphql.ResolveParams) (interface{}, error) {\r\n  t := struct {\r\n    FooBar string `graphql:\"fooBar\"`\r\n  }{\"foo bar value\"}\r\n  return t, nil\r\n},\r\n```\r\n\r\n\r\n\r\n","created_at":"2016-11-30T00:51:51Z","updated_at":"2016-11-30T00:51:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":{"login":"chris-ramon","id":1000404,"avatar_url":"https://avatars.githubusercontent.com/u/1000404?v=3","gravatar_id":"","url":"https://api.github.com/users/chris-ramon","html_url":"https://github.com/chris-ramon","followers_url":"https://api.github.com/users/chris-ramon/followers","following_url":"https://api.github.com/users/chris-ramon/following{/other_user}","gists_url":"https://api.github.com/users/chris-ramon/gists{/gist_id}","starred_url":"https://api.github.com/users/chris-ramon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chris-ramon/subscriptions","organizations_url":"https://api.github.com/users/chris-ramon/orgs","repos_url":"https://api.github.com/users/chris-ramon/repos","events_url":"https://api.github.com/users/chris-ramon/events{/privacy}","received_events_url":"https://api.github.com/users/chris-ramon/received_events","type":"User","site_admin":false},"assignees":[{"login":"chris-ramon","id":1000404,"avatar_url":"https://avatars.githubusercontent.com/u/1000404?v=3","gravatar_id":"","url":"https://api.github.com/users/chris-ramon","html_url":"https://github.com/chris-ramon","followers_url":"https://api.github.com/users/chris-ramon/followers","following_url":"https://api.github.com/users/chris-ramon/following{/other_user}","gists_url":"https://api.github.com/users/chris-ramon/gists{/gist_id}","starred_url":"https://api.github.com/users/chris-ramon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chris-ramon/subscriptions","organizations_url":"https://api.github.com/users/chris-ramon/orgs","repos_url":"https://api.github.com/users/chris-ramon/repos","events_url":"https://api.github.com/users/chris-ramon/events{/privacy}","received_events_url":"https://api.github.com/users/chris-ramon/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/graphql-go/graphql/pulls/173/commits","review_comments_url":"https://api.github.com/repos/graphql-go/graphql/pulls/173/comments","review_comment_url":"https://api.github.com/repos/graphql-go/graphql/pulls/comments{/number}","comments_url":"https://api.github.com/repos/graphql-go/graphql/issues/173/comments","statuses_url":"https://api.github.com/repos/graphql-go/graphql/statuses/547c31fd2f58c48ae6a23428369987721c11199a","head":{"label":"graphql-go:graphql-tag","ref":"graphql-tag","sha":"547c31fd2f58c48ae6a23428369987721c11199a","user":{"login":"graphql-go","id":14210643,"avatar_url":"https://avatars.githubusercontent.com/u/14210643?v=3","gravatar_id":"","url":"https://api.github.com/users/graphql-go","html_url":"https://github.com/graphql-go","followers_url":"https://api.github.com/users/graphql-go/followers","following_url":"https://api.github.com/users/graphql-go/following{/other_user}","gists_url":"https://api.github.com/users/graphql-go/gists{/gist_id}","starred_url":"https://api.github.com/users/graphql-go/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/graphql-go/subscriptions","organizations_url":"https://api.github.com/users/graphql-go/orgs","repos_url":"https://api.github.com/users/graphql-go/repos","events_url":"https://api.github.com/users/graphql-go/events{/privacy}","received_events_url":"https://api.github.com/users/graphql-go/received_events","type":"Organization","site_admin":false},"repo":{"id":39332913,"name":"graphql","full_name":"graphql-go/graphql","owner":{"login":"graphql-go","id":14210643,"avatar_url":"https://avatars.githubusercontent.com/u/14210643?v=3","gravatar_id":"","url":"https://api.github.com/users/graphql-go","html_url":"https://github.com/graphql-go","followers_url":"https://api.github.com/users/graphql-go/followers","following_url":"https://api.github.com/users/graphql-go/following{/other_user}","gists_url":"https://api.github.com/users/graphql-go/gists{/gist_id}","starred_url":"https://api.github.com/users/graphql-go/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/graphql-go/subscriptions","organizations_url":"https://api.github.com/users/graphql-go/orgs","repos_url":"https://api.github.com/users/graphql-go/repos","events_url":"https://api.github.com/users/graphql-go/events{/privacy}","received_events_url":"https://api.github.com/users/graphql-go/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/graphql-go/graphql","description":"An implementation of GraphQL for Go / Golang","fork":false,"url":"https://api.github.com/repos/graphql-go/graphql","forks_url":"https://api.github.com/repos/graphql-go/graphql/forks","keys_url":"https://api.github.com/repos/graphql-go/graphql/keys{/key_id}","collaborators_url":"https://api.github.com/repos/graphql-go/graphql/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/graphql-go/graphql/teams","hooks_url":"https://api.github.com/repos/graphql-go/graphql/hooks","issue_events_url":"https://api.github.com/repos/graphql-go/graphql/issues/events{/number}","events_url":"https://api.github.com/repos/graphql-go/graphql/events","assignees_url":"https://api.github.com/repos/graphql-go/graphql/assignees{/user}","branches_url":"https://api.github.com/repos/graphql-go/graphql/branches{/branch}","tags_url":"https://api.github.com/repos/graphql-go/graphql/tags","blobs_url":"https://api.github.com/repos/graphql-go/graphql/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/graphql-go/graphql/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/graphql-go/graphql/git/refs{/sha}","trees_url":"https://api.github.com/repos/graphql-go/graphql/git/trees{/sha}","statuses_url":"https://api.github.com/repos/graphql-go/graphql/statuses/{sha}","languages_url":"https://api.github.com/repos/graphql-go/graphql/languages","stargazers_url":"https://api.github.com/repos/graphql-go/graphql/stargazers","contributors_url":"https://api.github.com/repos/graphql-go/graphql/contributors","subscribers_url":"https://api.github.com/repos/graphql-go/graphql/subscribers","subscription_url":"https://api.github.com/repos/graphql-go/graphql/subscription","commits_url":"https://api.github.com/repos/graphql-go/graphql/commits{/sha}","git_commits_url":"https://api.github.com/repos/graphql-go/graphql/git/commits{/sha}","comments_url":"https://api.github.com/repos/graphql-go/graphql/comments{/number}","issue_comment_url":"https://api.github.com/repos/graphql-go/graphql/issues/comments{/number}","contents_url":"https://api.github.com/repos/graphql-go/graphql/contents/{+path}","compare_url":"https://api.github.com/repos/graphql-go/graphql/compare/{base}...{head}","merges_url":"https://api.github.com/repos/graphql-go/graphql/merges","archive_url":"https://api.github.com/repos/graphql-go/graphql/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/graphql-go/graphql/downloads","issues_url":"https://api.github.com/repos/graphql-go/graphql/issues{/number}","pulls_url":"https://api.github.com/repos/graphql-go/graphql/pulls{/number}","milestones_url":"https://api.github.com/repos/graphql-go/graphql/milestones{/number}","notifications_url":"https://api.github.com/repos/graphql-go/graphql/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/graphql-go/graphql/labels{/name}","releases_url":"https://api.github.com/repos/graphql-go/graphql/releases{/id}","deployments_url":"https://api.github.com/repos/graphql-go/graphql/deployments","created_at":"2015-07-19T12:25:43Z","updated_at":"2016-11-29T07:48:15Z","pushed_at":"2016-11-30T00:51:51Z","git_url":"git://github.com/graphql-go/graphql.git","ssh_url":"git@github.com:graphql-go/graphql.git","clone_url":"https://github.com/graphql-go/graphql.git","svn_url":"https://github.com/graphql-go/graphql","homepage":"","size":6587,"stargazers_count":810,"watchers_count":810,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":94,"mirror_url":null,"open_issues_count":57,"forks":94,"open_issues":57,"watchers":810,"default_branch":"master"}},"base":{"label":"graphql-go:master","ref":"master","sha":"8c317402d1b72dff3dd9008bad7e41d0ae96e3c6","user":{"login":"graphql-go","id":14210643,"avatar_url":"https://avatars.githubusercontent.com/u/14210643?v=3","gravatar_id":"","url":"https://api.github.com/users/graphql-go","html_url":"https://github.com/graphql-go","followers_url":"https://api.github.com/users/graphql-go/followers","following_url":"https://api.github.com/users/graphql-go/following{/other_user}","gists_url":"https://api.github.com/users/graphql-go/gists{/gist_id}","starred_url":"https://api.github.com/users/graphql-go/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/graphql-go/subscriptions","organizations_url":"https://api.github.com/users/graphql-go/orgs","repos_url":"https://api.github.com/users/graphql-go/repos","events_url":"https://api.github.com/users/graphql-go/events{/privacy}","received_events_url":"https://api.github.com/users/graphql-go/received_events","type":"Organization","site_admin":false},"repo":{"id":39332913,"name":"graphql","full_name":"graphql-go/graphql","owner":{"login":"graphql-go","id":14210643,"avatar_url":"https://avatars.githubusercontent.com/u/14210643?v=3","gravatar_id":"","url":"https://api.github.com/users/graphql-go","html_url":"https://github.com/graphql-go","followers_url":"https://api.github.com/users/graphql-go/followers","following_url":"https://api.github.com/users/graphql-go/following{/other_user}","gists_url":"https://api.github.com/users/graphql-go/gists{/gist_id}","starred_url":"https://api.github.com/users/graphql-go/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/graphql-go/subscriptions","organizations_url":"https://api.github.com/users/graphql-go/orgs","repos_url":"https://api.github.com/users/graphql-go/repos","events_url":"https://api.github.com/users/graphql-go/events{/privacy}","received_events_url":"https://api.github.com/users/graphql-go/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/graphql-go/graphql","description":"An implementation of GraphQL for Go / Golang","fork":false,"url":"https://api.github.com/repos/graphql-go/graphql","forks_url":"https://api.github.com/repos/graphql-go/graphql/forks","keys_url":"https://api.github.com/repos/graphql-go/graphql/keys{/key_id}","collaborators_url":"https://api.github.com/repos/graphql-go/graphql/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/graphql-go/graphql/teams","hooks_url":"https://api.github.com/repos/graphql-go/graphql/hooks","issue_events_url":"https://api.github.com/repos/graphql-go/graphql/issues/events{/number}","events_url":"https://api.github.com/repos/graphql-go/graphql/events","assignees_url":"https://api.github.com/repos/graphql-go/graphql/assignees{/user}","branches_url":"https://api.github.com/repos/graphql-go/graphql/branches{/branch}","tags_url":"https://api.github.com/repos/graphql-go/graphql/tags","blobs_url":"https://api.github.com/repos/graphql-go/graphql/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/graphql-go/graphql/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/graphql-go/graphql/git/refs{/sha}","trees_url":"https://api.github.com/repos/graphql-go/graphql/git/trees{/sha}","statuses_url":"https://api.github.com/repos/graphql-go/graphql/statuses/{sha}","languages_url":"https://api.github.com/repos/graphql-go/graphql/languages","stargazers_url":"https://api.github.com/repos/graphql-go/graphql/stargazers","contributors_url":"https://api.github.com/repos/graphql-go/graphql/contributors","subscribers_url":"https://api.github.com/repos/graphql-go/graphql/subscribers","subscription_url":"https://api.github.com/repos/graphql-go/graphql/subscription","commits_url":"https://api.github.com/repos/graphql-go/graphql/commits{/sha}","git_commits_url":"https://api.github.com/repos/graphql-go/graphql/git/commits{/sha}","comments_url":"https://api.github.com/repos/graphql-go/graphql/comments{/number}","issue_comment_url":"https://api.github.com/repos/graphql-go/graphql/issues/comments{/number}","contents_url":"https://api.github.com/repos/graphql-go/graphql/contents/{+path}","compare_url":"https://api.github.com/repos/graphql-go/graphql/compare/{base}...{head}","merges_url":"https://api.github.com/repos/graphql-go/graphql/merges","archive_url":"https://api.github.com/repos/graphql-go/graphql/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/graphql-go/graphql/downloads","issues_url":"https://api.github.com/repos/graphql-go/graphql/issues{/number}","pulls_url":"https://api.github.com/repos/graphql-go/graphql/pulls{/number}","milestones_url":"https://api.github.com/repos/graphql-go/graphql/milestones{/number}","notifications_url":"https://api.github.com/repos/graphql-go/graphql/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/graphql-go/graphql/labels{/name}","releases_url":"https://api.github.com/repos/graphql-go/graphql/releases{/id}","deployments_url":"https://api.github.com/repos/graphql-go/graphql/deployments","created_at":"2015-07-19T12:25:43Z","updated_at":"2016-11-29T07:48:15Z","pushed_at":"2016-11-30T00:51:51Z","git_url":"git://github.com/graphql-go/graphql.git","ssh_url":"git@github.com:graphql-go/graphql.git","clone_url":"https://github.com/graphql-go/graphql.git","svn_url":"https://github.com/graphql-go/graphql","homepage":"","size":6587,"stargazers_count":810,"watchers_count":810,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":94,"mirror_url":null,"open_issues_count":57,"forks":94,"open_issues":57,"watchers":810,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/graphql-go/graphql/pulls/173"},"html":{"href":"https://github.com/graphql-go/graphql/pull/173"},"issue":{"href":"https://api.github.com/repos/graphql-go/graphql/issues/173"},"comments":{"href":"https://api.github.com/repos/graphql-go/graphql/issues/173/comments"},"review_comments":{"href":"https://api.github.com/repos/graphql-go/graphql/pulls/173/comments"},"review_comment":{"href":"https://api.github.com/repos/graphql-go/graphql/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/graphql-go/graphql/pulls/173/commits"},"statuses":{"href":"https://api.github.com/repos/graphql-go/graphql/statuses/547c31fd2f58c48ae6a23428369987721c11199a"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":60,"deletions":10,"changed_files":2}}
{"actor":{"display_login":"chris-ramon"}}