Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TS IntelliSense doesn't show any completion for queries in VS Code #103

Open
talentlessguy opened this issue Mar 28, 2020 · 1 comment
Open

Comments

@talentlessguy
Copy link

talentlessguy commented Mar 28, 2020


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

  1. Run API, then generate types using pnpx ts-graphql-plugin typegen
  2. 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
  }
}
  1. 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

image

@talentlessguy
Copy link
Author

talentlessguy commented Mar 28, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant