ts-graphql-plugin
ts-graphql-plugin copied to clipboard
TS IntelliSense doesn't show any completion for queries in VS Code
name: Bug report about: Create a report to help us improve title: '' labels: '' assignees: '' ---Describe the bug Generated types aren't used by VS Code, so there are no any auto-completion options showing
To Reproduce
My case
- Run API, then generate types using
pnpx ts-graphql-plugin typegen - Extend Next.js config:
const TsGraphQLPlugin = require('ts-graphql-plugin/webpack')
const tsgqlPlugin = new TsGraphQLPlugin()
module.exports = {
target: 'serverless',
env:
{ API: 'http://localhost:8080', GRAPHQL: 'http://localhost:8080/graphql' },
webpack: config => {
config.module.rules.push({
test: /\.tsx?$/,
exclude: /node_modules/,
loader: 'ts-loader',
options: {
getCustomTransformers: () => ({
before: [tsgqlPlugin.getTransformer()]
})
}
})
return config
}
}
- Put plugin inside of tsconfig:
{
"compilerOptions": {
// ...
"plugins": [
{
"name": "ts-graphql-plugin",
"schema": {
"http": {
"method": "POST",
"url": "http://localhost:8080/graphql"
}
},
"tag": "gql"
}
]
},
// ...
}
Manual installation
Clone two repos, build api, launch it, then build frontend
- API
git clone https://github.com/komfy/api.git
cd api
go mod download
go run dev-server/server.go
- Frontend
git clone https://github.com/komfy/frontend.git
cd frontend
pnpm i # or npm i
pnpm run dev # or npm run dev
pnpx ts-graphql-plugin typegen # or npx ts-graphql-plugin typegen
Expected behavior I expected my exported types to autocomplete my queries
Debug log

Update: after trying to rebuild the application with extended config, it hangs