MCPcopy Index your code
hub / github.com/0no-co/GraphQLSP

github.com/0no-co/GraphQLSP @v0.2.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.2.0 ↗ · + Follow
29 symbols 78 edges 13 files 1 documented · 3% 3 cross-repo links
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

GraphQLSP

This is a TypeScript LSP Plugin that will recognise documents in your TypeScript code and help you out with hover-information, diagnostics, auto-complete and automatically generating Typed-Document-nodes

Features

  • Hover information showing the decriptions of fields
  • Diagnostics for adding fields that don't exist, are deprecated, missmatched argument types, ...
  • Auto-complete inside your editor for fields
  • When you save it will generate typed-document-nodes for your documents and cast them to the correct type

Installation

npm install -D @0no-co/graphqlsp

Usage

Go to your tsconfig.json and add

{
  "compilerOptions": {
    "plugins": [
      {
        "name": "@0no-co/graphqlsp",
        "schema": "./schema.graphql"
      }
    ]
  }
}

now restart your TS-server and you should be good to go

Local development

Run yarn in both / as well as /example.

Open two terminal tabs, one where you run the build command which is yarn tsc and one intended to open our /example, most of the debugging will happen through setting breakpoints.

Run TSS_DEBUG_BRK=9559 code example and ensure that the TypeScript used is the one from the workspace the .vscode folder should ensure that but sometimes it fails. When we use TSS_DEBUG_BRK the plugin won't run until we attach the debugger from our main editor.

After making changes you'll have to re-open said editor or restart the TypeScript server and re-attach the debugger. Breakpoints have to be set in the transpiled JS-code hence using tsc currently so the code is a bit easier to navigate.

Extension points exported contracts — how you extend this code

Token (Interface)
(no doc)
src/token.ts

Core symbols most depended-on inside this repo

logger
called by 10
src/index.ts
resolveTemplate
called by 4
src/resolve.ts
getSource
called by 4
src/utils.ts
findNode
called by 3
src/utils.ts
filterNonEmpty
called by 3
src/utils.ts
isFileDirty
called by 2
src/utils.ts
find
called by 2
src/utils.ts
normalizeText
called by 2
src/utils.ts

Shape

Function 22
Method 4
Class 2
Interface 1

Languages

TypeScript100%

Modules by API surface

src/utils.ts12 symbols
src/cursor.ts6 symbols
src/index.ts4 symbols
src/token.ts2 symbols
scripts/changelog.js2 symbols
src/types/generate.ts1 symbols
src/resolve.ts1 symbols
src/getSchema.ts1 symbols

For agents

$ claude mcp add GraphQLSP \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact