{"action":"created","issue":{"url":"https://api.github.com/repos/vektah/gqlgen/issues/27","repository_url":"https://api.github.com/repos/vektah/gqlgen","labels_url":"https://api.github.com/repos/vektah/gqlgen/issues/27/labels{/name}","comments_url":"https://api.github.com/repos/vektah/gqlgen/issues/27/comments","events_url":"https://api.github.com/repos/vektah/gqlgen/issues/27/events","html_url":"https://github.com/vektah/gqlgen/issues/27","id":299833886,"number":27,"title":"Question: Access selected fields in resolver","user":{"login":"jbub","id":551113,"avatar_url":"https://avatars3.githubusercontent.com/u/551113?v=4","gravatar_id":"","url":"https://api.github.com/users/jbub","html_url":"https://github.com/jbub","followers_url":"https://api.github.com/users/jbub/followers","following_url":"https://api.github.com/users/jbub/following{/other_user}","gists_url":"https://api.github.com/users/jbub/gists{/gist_id}","starred_url":"https://api.github.com/users/jbub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbub/subscriptions","organizations_url":"https://api.github.com/users/jbub/orgs","repos_url":"https://api.github.com/users/jbub/repos","events_url":"https://api.github.com/users/jbub/events{/privacy}","received_events_url":"https://api.github.com/users/jbub/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-23T20:03:58Z","updated_at":"2018-02-26T07:37:03Z","closed_at":null,"author_association":"NONE","body":"Hello, first thank you for a great project! Great job!\r\n\r\nI have a question, say i am using postgres as my datasource for resolvers and i want to take advantage of the fact that graphql allows us to select subset of fields. So i want to just query fields i need to optimize the query.\r\n\r\nNow how would i go about that when implementing resolvers for example:\r\n\r\n```graphql\r\nquery findTodos {\r\n  todos {\r\n    text\r\n    done\r\n  }\r\n}\r\n```\r\n\r\n```go\r\nfunc (r *TodoResolver) Query_todos(ctx context.Context) ([]Todo, error) {\r\n    // how do i access which of the fields were selected in the query here\r\n    rows, err := r.db.Query(\"SELECT text, done FROM todos\")\r\n}\r\n```\r\n\r\nThank you for any pointers :) Keep up the great job!"},"comment":{"url":"https://api.github.com/repos/vektah/gqlgen/issues/comments/368414150","html_url":"https://github.com/vektah/gqlgen/issues/27#issuecomment-368414150","issue_url":"https://api.github.com/repos/vektah/gqlgen/issues/27","id":368414150,"user":{"login":"vektah","id":2247982,"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},"created_at":"2018-02-26T07:37:03Z","updated_at":"2018-02-26T07:37:03Z","author_association":"OWNER","body":"Sorry, This isn't currently being exposed, but it will get added shortly for [Schema stitching](https://github.com/vektah/gqlgen/issues/5). \r\n\r\n"}}
{"actor":{"display_login":"vektah"}}