-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
We're referencing quite a lot of the generated GQL types within our project and end up with quite annoying, and easy to break imports like
const QUERY = gql`
query Something{}
` as import('../../../../__generated__/ts-gql/Something').type;
As a solution we attempted using TS path aliases, such that in tsconfig.json we put
{
"compilerOptions": {
"paths": {
"@gql/*": ["../../../../__generated__/ts-gql/*"]
}
}
}
and our import becomes:
const QUERY = gql`
query Something{}
` as import('@gql/Something').type;
However that is not accepted by the eslint plugin, which will complain with:
error You must cast gql tags with the generated type @ts-gql/ts-gql
I haven't found a workaround yet. tsc
is happy with the imports, if I disable the ts-sql eslint plugin then I can build it in Next.js context.
Is there an easy fix or does it require refactoring the plugin?
Cheers,
Metadata
Metadata
Assignees
Labels
No labels