babel-plugin-import-graphql icon indicating copy to clipboard operation
babel-plugin-import-graphql copied to clipboard

Plugin makes it impossible to import .gql.ts and .graphql.ts files

Open nielsmadan opened this issue 2 years ago • 1 comments

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

nielsmadan avatar Mar 15 '22 11:03 nielsmadan