Open nielsmadan opened 2 years ago
@nielsmadan I couldn't realize the use of those files with GraphQL syntax but added .ts extension.
The original extension is important to retain. If you change it to TypeScript syntax you'll need a parser, but GraphQL has this parser natively or with a package.
A granulated code with the GraphQL code separated fits better and you separate codes from different syntax brings more readability for developing.
What you suggest more about?
In order to import a file with .gql.ts extension, you would omit the
.ts
part in the import statement.Since the plugin looks at
importPath
rather than the name of the actual file, it will handle it and import it as graphql, which will fail (assuming it is a ts file).Attaching a patch that would fix it, but of course not sure if this has other implications.
babel-plugin-import-graphql+2.8.1.patch.txt