{"action":"opened","issue":{"url":"https://api.github.com/repos/apollographql/react-apollo/issues/786","repository_url":"https://api.github.com/repos/apollographql/react-apollo","labels_url":"https://api.github.com/repos/apollographql/react-apollo/issues/786/labels{/name}","comments_url":"https://api.github.com/repos/apollographql/react-apollo/issues/786/comments","events_url":"https://api.github.com/repos/apollographql/react-apollo/issues/786/events","html_url":"https://github.com/apollographql/react-apollo/issues/786","id":236372263,"number":786,"title":"New TypeScript definitions broken + cause critical slowdowns of the language server","user":{"login":"dsifford","id":5240018,"avatar_url":"https://avatars3.githubusercontent.com/u/5240018?v=3","gravatar_id":"","url":"https://api.github.com/users/dsifford","html_url":"https://github.com/dsifford","followers_url":"https://api.github.com/users/dsifford/followers","following_url":"https://api.github.com/users/dsifford/following{/other_user}","gists_url":"https://api.github.com/users/dsifford/gists{/gist_id}","starred_url":"https://api.github.com/users/dsifford/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dsifford/subscriptions","organizations_url":"https://api.github.com/users/dsifford/orgs","repos_url":"https://api.github.com/users/dsifford/repos","events_url":"https://api.github.com/users/dsifford/events{/privacy}","received_events_url":"https://api.github.com/users/dsifford/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-06-16T03:43:16Z","updated_at":"2017-06-16T03:43:16Z","closed_at":null,"body":"Opening this issue from per the request of @jbaxleyiii in https://github.com/apollographql/react-apollo/pull/695#issuecomment-307812329\r\n\r\n## The Gist\r\nMy personal issue in detail can be found in #695. In short, here's the issues I'm experiencing:\r\n\r\n#### 1. The nested deeply-dependent type definitions are causing Visual Studio Code to freeze on any file that contains the `graphql` function provided by this library.\r\n\r\n- I'm running a Linux machine with a 4-year-old intel i7 quad-core processor and that's still not enough to make VSCode not be completely sluggish.\\*\r\n- When I \"click to definition\" on the `graphql` function, my editor crashes completely.\r\n\r\n> \\* Machine specifics: `Linux archlinux 4.11.3-1-ARCH #1 SMP PREEMPT Sun May 28 10:40:17 CEST 2017 x86_64 GNU/Linux`\r\n\r\n#### 2. Types will not compile even after adjusting the code in my application.\r\n\r\n- The types currently do not compile in their current form (after adjusting per the suggestions in both the PR and the changelog) for in the application where I'm using react-apollo. ([this file specifically](https://github.com/aliemteam/aliemcards/blob/master/app/cards/Card.tsx)).\r\n- The types currently do not compile **in this repository** in this file: https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/api.test.tsx.\r\n- Other known users to be affected by this are @alexzielenski and @exihuatl (based on comments/reactions in the pull request thread).\r\n\r\n#### 3. The tests for the new type definitions are being tested against components that all have the `any` type for both `Props` and `State`, which seems dangerous.\r\n\r\n<details>\r\n  <summary>[Click me] Literally every query test case is affected by this potentially dangerous type casting.</summary>\r\n<ul>\r\n<li><a href=\"https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/api.test.tsx#L50\">https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/api.test.tsx#L50</a></li>\r\n<li><a href=\"https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/api.test.tsx#L93\">https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/api.test.tsx#L93</a></li>\r\n<li><a href=\"https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/api.test.tsx#L124\">https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/api.test.tsx#L124</a></li>\r\n<li><a href=\"https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/api.test.tsx#L202\">https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/api.test.tsx#L202</a></li>\r\n<li><a href=\"https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/errors.test.tsx#L81\">https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/errors.test.tsx#L81</a></li>\r\n<li><a href=\"https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/errors.test.tsx#L124\">https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/errors.test.tsx#L124</a></li>\r\n<li><a href=\"https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/errors.test.tsx#L162\">https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/errors.test.tsx#L162</a></li>\r\n<li><a href=\"https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/errors.test.tsx#L212\">https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/errors.test.tsx#L212</a></li>\r\n<li><a href=\"https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/errors.test.tsx#L264\">https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/errors.test.tsx#L264</a></li>\r\n<li><a href=\"https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/index.test.tsx#L99\">https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/index.test.tsx#L99</a></li>\r\n<li><a href=\"https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/index.test.tsx#L126\">https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/index.test.tsx#L126</a></li>\r\n<li><a href=\"https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/index.test.tsx#L156\">https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/index.test.tsx#L156</a></li>\r\n<li><a href=\"https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/index.test.tsx#L186\">https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/index.test.tsx#L186</a></li>\r\n<li><a href=\"https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/index.test.tsx#L256\">https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/index.test.tsx#L256</a></li>\r\n<li><a href=\"https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/index.test.tsx#L329\">https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/index.test.tsx#L329</a></li>\r\n<li><a href=\"https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/index.test.tsx#L359\">https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/index.test.tsx#L359</a></li>\r\n<li><a href=\"https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/lifecycle.test.tsx#L61\">https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/lifecycle.test.tsx#L61</a></li>\r\n<li><a href=\"https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/lifecycle.test.tsx#L155\">https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/lifecycle.test.tsx#L155</a></li>\r\n<li><a href=\"https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/lifecycle.test.tsx#L211\">https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/lifecycle.test.tsx#L211</a></li>\r\n<li><a href=\"https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/lifecycle.test.tsx#L258\">https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/lifecycle.test.tsx#L258</a></li>\r\n<li><a href=\"https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/lifecycle.test.tsx#L311\">https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/lifecycle.test.tsx#L311</a></li>\r\n<li><a href=\"https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/lifecycle.test.tsx#L367\">https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/lifecycle.test.tsx#L367</a></li>\r\n<li><a href=\"https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/loading.test.tsx#L44\">https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/loading.test.tsx#L44</a></li>\r\n<li><a href=\"https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/loading.test.tsx#L68\">https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/loading.test.tsx#L68</a></li>\r\n<li><a href=\"https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/loading.test.tsx#L94\">https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/loading.test.tsx#L94</a></li>\r\n<li><a href=\"https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/loading.test.tsx#L134\">https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/loading.test.tsx#L134</a></li>\r\n<li><a href=\"https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/loading.test.tsx#L187\">https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/loading.test.tsx#L187</a></li>\r\n<li><a href=\"https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/loading.test.tsx#L232\">https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/loading.test.tsx#L232</a></li>\r\n<li><a href=\"https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/loading.test.tsx#L280\">https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/loading.test.tsx#L280</a></li>\r\n<li><a href=\"https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/loading.test.tsx#L329\">https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/loading.test.tsx#L329</a></li>\r\n<li><a href=\"https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/loading.test.tsx#L402\">https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/loading.test.tsx#L402</a></li>\r\n<li><a href=\"https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/observableQuery.test.tsx#L66\">https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/observableQuery.test.tsx#L66</a></li>\r\n<li><a href=\"https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/observableQuery.test.tsx#L179\">https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/observableQuery.test.tsx#L179</a></li>\r\n<li><a href=\"https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/observableQuery.test.tsx#L215\">https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/observableQuery.test.tsx#L215</a></li>\r\n<li><a href=\"https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/observableQuery.test.tsx#L267\">https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/observableQuery.test.tsx#L267</a></li>\r\n<li><a href=\"https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/observableQuery.test.tsx#L335\">https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/observableQuery.test.tsx#L335</a></li>\r\n<li><a href=\"https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/polling.test.tsx#L70\">https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/polling.test.tsx#L70</a></li>\r\n<li><a href=\"https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/polling.test.tsx#L94\">https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/polling.test.tsx#L94</a></li>\r\n<li><a href=\"https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/skip.test.tsx#L45\">https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/skip.test.tsx#L45</a></li>\r\n<li><a href=\"https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/skip.test.tsx#L71\">https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/skip.test.tsx#L71</a></li>\r\n<li><a href=\"https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/skip.test.tsx#L101\">https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/skip.test.tsx#L101</a></li>\r\n<li><a href=\"https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/skip.test.tsx#L138\">https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/skip.test.tsx#L138</a></li>\r\n<li><a href=\"https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/skip.test.tsx#L164\">https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/skip.test.tsx#L164</a></li>\r\n<li><a href=\"https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/skip.test.tsx#L192\">https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/skip.test.tsx#L192</a></li>\r\n<li><a href=\"https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/skip.test.tsx#L236\">https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/skip.test.tsx#L236</a></li>\r\n<li><a href=\"https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/skip.test.tsx#L296\">https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/skip.test.tsx#L296</a></li>\r\n<li><a href=\"https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/skip.test.tsx#L366\">https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/skip.test.tsx#L366</a></li>\r\n<li><a href=\"https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/skip.test.tsx#L413\">https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/skip.test.tsx#L413</a></li>\r\n<li><a href=\"https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/updateQuery.test.tsx#L44\">https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/updateQuery.test.tsx#L44</a></li>\r\n<li><a href=\"https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/updateQuery.test.tsx#L69\">https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/updateQuery.test.tsx#L69</a></li>\r\n<li><a href=\"https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/updateQuery.test.tsx#L90\">https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/updateQuery.test.tsx#L90</a></li>\r\n<li><a href=\"https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/updateQuery.test.tsx#L122\">https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/updateQuery.test.tsx#L122</a></li>\r\n<li><a href=\"https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/updateQuery.test.tsx#L159\">https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/updateQuery.test.tsx#L159</a></li>\r\n</ul>\r\n</details>\r\n\r\n\r\n## Suggestions\r\n\r\nAside from fixing the compile issues and the `any` type casting described above, perhaps there might be a way to make the type dependency chain not so long? This singular problem I think is the issue for users (like me) who depend on realtime type checking using the typescript language server. (This is a standard feature in Visual Studio Code).\r\n\r\n> **Aside:** From the images that @jbaxleyiii posted in his pull-request, it _appears_ that he's also using VSCode. I'm wondering why these issues are not also affecting him? I wonder what type of machine he's running?\r\n\r\n\r\n## Steps to Reproduce\r\n\r\n(This should be the easiest thing to reproduce from the list of issues I described above).\r\n1. Open https://github.com/apollographql/react-apollo/blob/master/test/react-web/client/graphql/queries/api.test.tsx in this repository in Visual Studio Code. Does this compile for you?\r\n\r\n### Version\r\n- apollo-client@1.4.2\r\n- react-apollo@1.4.2\r\n- typescript@2.4.0\r\n\r\n## Final Notes\r\n\r\nI'm happy to help in any way I can. Regardless of these issues, you all deserve a huge high-five for such amazing work on the apollo platform. Seriously has made my API development experience much more enjoyable! Thanks for all you and the apollo team does! 😄 👏  \r\n"}}
{"actor":{"display_login":"dsifford"}}