{"action":"created","issue":{"url":"https://api.github.com/repos/apollographql/react-apollo/issues/2539","repository_url":"https://api.github.com/repos/apollographql/react-apollo","labels_url":"https://api.github.com/repos/apollographql/react-apollo/issues/2539/labels{/name}","comments_url":"https://api.github.com/repos/apollographql/react-apollo/issues/2539/comments","events_url":"https://api.github.com/repos/apollographql/react-apollo/issues/2539/events","html_url":"https://github.com/apollographql/react-apollo/issues/2539","id":374270718,"node_id":"MDU6SXNzdWUzNzQyNzA3MTg=","number":2539,"title":"React Hooks support","user":{"login":"wzrdzl","id":1524432,"node_id":"MDQ6VXNlcjE1MjQ0MzI=","avatar_url":"https://avatars2.githubusercontent.com/u/1524432?v=4","gravatar_id":"","url":"https://api.github.com/users/wzrdzl","html_url":"https://github.com/wzrdzl","followers_url":"https://api.github.com/users/wzrdzl/followers","following_url":"https://api.github.com/users/wzrdzl/following{/other_user}","gists_url":"https://api.github.com/users/wzrdzl/gists{/gist_id}","starred_url":"https://api.github.com/users/wzrdzl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wzrdzl/subscriptions","organizations_url":"https://api.github.com/users/wzrdzl/orgs","repos_url":"https://api.github.com/users/wzrdzl/repos","events_url":"https://api.github.com/users/wzrdzl/events{/privacy}","received_events_url":"https://api.github.com/users/wzrdzl/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":24,"created_at":"2018-10-26T08:03:36Z","updated_at":"2018-11-02T10:58:35Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"I'd like to start a discussion about the possible next-gen API based on [react hooks](https://reactjs.org/docs/hooks-intro.html) for `react-apollo`.\r\nI think this API brings a perfect opportunity for `react-apollo` to improve already excellent DX even more.\r\n\r\n```js\r\n// isn't this beatiful?\r\nfunction Avatar() {\r\n  const { loading, error, data } = useQuery(`\r\n    {\r\n       me {\r\n          initial\r\n       }\r\n    }\r\n  `);\r\n\r\n  if (loading) return <div>Loading...<div>;\r\n\r\n  if (error) return <div>Error happened</div>\r\n\r\n  return (\r\n    <div>{data.me.initial}<div>\r\n  );\r\n} \r\n```\r\n\r\nWhat do you guys think?\r\n"},"comment":{"url":"https://api.github.com/repos/apollographql/react-apollo/issues/comments/435343028","html_url":"https://github.com/apollographql/react-apollo/issues/2539#issuecomment-435343028","issue_url":"https://api.github.com/repos/apollographql/react-apollo/issues/2539","id":435343028,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNTM0MzAyOA==","user":{"login":"trojanowski","id":1078103,"node_id":"MDQ6VXNlcjEwNzgxMDM=","avatar_url":"https://avatars3.githubusercontent.com/u/1078103?v=4","gravatar_id":"","url":"https://api.github.com/users/trojanowski","html_url":"https://github.com/trojanowski","followers_url":"https://api.github.com/users/trojanowski/followers","following_url":"https://api.github.com/users/trojanowski/following{/other_user}","gists_url":"https://api.github.com/users/trojanowski/gists{/gist_id}","starred_url":"https://api.github.com/users/trojanowski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trojanowski/subscriptions","organizations_url":"https://api.github.com/users/trojanowski/orgs","repos_url":"https://api.github.com/users/trojanowski/repos","events_url":"https://api.github.com/users/trojanowski/events{/privacy}","received_events_url":"https://api.github.com/users/trojanowski/received_events","type":"User","site_admin":false},"created_at":"2018-11-02T10:58:35Z","updated_at":"2018-11-02T10:58:35Z","author_association":"NONE","body":"@hlehmann Could you please create an issue at https://github.com/trojanowski/react-apollo-hooks/issues with more details?"}}
{"actor":{"display_login":"trojanowski"}}