首页 > 解决方案 > 如何在 VS Code 中调试我的 typegraphql 解析器?

问题描述

所以我让我的 typeorm、typegraphql、apollo-server-express、typescript 端点启动并运行解析器、突变和所有这些东西。

拥有 ac# 背景时,我有时想在向操场发出请求时调试我的端点,以找出我做错了什么。我还没有找到 vscode 允许我这样做的设置,谷歌也没有太大帮助。

我想要达到的目标有可能吗?谢谢

标签: apollo-servervscode-debuggertypegraphql

解决方案


我使用以下launch.json制作它,也许这对其他人有帮助

{
    "version": "0.2.0",
    "configurations": [
        {
          "name": "Example",
          "type": "node",
          "request": "launch",
          "runtimeExecutable": "node",
          "runtimeArgs": ["--nolazy", "-r", "ts-node/register"],
    
          "args": ["src/index.ts", "--transpile-only", "hello"],
          
          "cwd": "${workspaceRoot}",
          "internalConsoleOptions": "openOnSessionStart",
          "skipFiles": ["<node_internals>/**", "node_modules/**"]
        }
      ]
  }

推荐阅读