{"action":"created","issue":{"url":"https://api.github.com/repos/apollographql/graphql-tag/issues/59","repository_url":"https://api.github.com/repos/apollographql/graphql-tag","labels_url":"https://api.github.com/repos/apollographql/graphql-tag/issues/59/labels{/name}","comments_url":"https://api.github.com/repos/apollographql/graphql-tag/issues/59/comments","events_url":"https://api.github.com/repos/apollographql/graphql-tag/issues/59/events","html_url":"https://github.com/apollographql/graphql-tag/issues/59","id":213555082,"number":59,"title":"Typescript: import fail: Cannot find module 'query.gql'","user":{"login":"estaub","id":1131334,"avatar_url":"https://avatars2.githubusercontent.com/u/1131334?v=3","gravatar_id":"","url":"https://api.github.com/users/estaub","html_url":"https://github.com/estaub","followers_url":"https://api.github.com/users/estaub/followers","following_url":"https://api.github.com/users/estaub/following{/other_user}","gists_url":"https://api.github.com/users/estaub/gists{/gist_id}","starred_url":"https://api.github.com/users/estaub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/estaub/subscriptions","organizations_url":"https://api.github.com/users/estaub/orgs","repos_url":"https://api.github.com/users/estaub/repos","events_url":"https://api.github.com/users/estaub/events{/privacy}","received_events_url":"https://api.github.com/users/estaub/received_events","type":"User","site_admin":false},"labels":[{"id":398113654,"url":"https://api.github.com/repos/apollographql/graphql-tag/labels/bug","name":"bug","color":"ee0701","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2017-03-11T19:56:55Z","updated_at":"2017-06-21T07:50:41Z","closed_at":null,"body":"This is a reopen of https://github.com/apollographql/graphql-tag/issues/42 .  \r\n\r\nNothing has changed, it's just that the presence of a workaround is not a fix.\r\n\r\nAs described before, attempts to import a graphql module result in `Cannot find module...`.  Using `require` instead of `import`, eg:\r\n\r\n`const query = require('gql/Query.gql');\r\n`\r\n\r\nworks fine... up to a point.  Somewhere, the Apollo `graphql` decorator performs  a deep copy of the query  The `query` DocumentNode returned above includes a `default` element that has itself as a property.  As a result, the deep copy blows out with a soft stack overflow.  So the full workaround is:\r\n\r\n`const query = require('gql/Query.gql');\r\ndelete query['default']\r\n`\r\n\r\nIt's possible that the `default` problem is dependent on the `tsconfig.json` setting:\r\n\r\n`\"allowSyntheticDefaultImports\": true`\r\n\r\nI need it for other reasons, and was unable to easily test with it turned off."},"comment":{"url":"https://api.github.com/repos/apollographql/graphql-tag/issues/comments/309992360","html_url":"https://github.com/apollographql/graphql-tag/issues/59#issuecomment-309992360","issue_url":"https://api.github.com/repos/apollographql/graphql-tag/issues/59","id":309992360,"user":{"login":"Aides359","id":2143625,"avatar_url":"https://avatars1.githubusercontent.com/u/2143625?v=3","gravatar_id":"","url":"https://api.github.com/users/Aides359","html_url":"https://github.com/Aides359","followers_url":"https://api.github.com/users/Aides359/followers","following_url":"https://api.github.com/users/Aides359/following{/other_user}","gists_url":"https://api.github.com/users/Aides359/gists{/gist_id}","starred_url":"https://api.github.com/users/Aides359/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Aides359/subscriptions","organizations_url":"https://api.github.com/users/Aides359/orgs","repos_url":"https://api.github.com/users/Aides359/repos","events_url":"https://api.github.com/users/Aides359/events{/privacy}","received_events_url":"https://api.github.com/users/Aides359/received_events","type":"User","site_admin":false},"created_at":"2017-06-21T07:50:41Z","updated_at":"2017-06-21T07:50:41Z","body":"@ddetkovs this fell of my radar, however I have now taken a look at my generated output.\r\n\r\nWhile I don't know about `makeExecutableSchema` as I am currently only using it to write queries for me the generated code is\r\n```\r\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__request_foo_graphql__ = __webpack_require__(5);\r\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__request_foo_graphql___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4__request_foo_graphql__);\r\n\r\napollo.watchQuery({\r\n   query:  __WEBPACK_IMPORTED_MODULE_4__request_foo_graphql___default\r\n})\r\n```\r\n\r\nwhich works just fine."}}
{"actor":{"display_login":"Aides359"}}