A Claude Code plugin providing comprehensive GraphQL development support through:
- graphql-lsp server integration for IDE-like features
- Automated hooks for validation, formatting, and linting
- GraphQL ecosystem integration (Prettier, GraphQL Code Generator)
# Run the setup command (after installing the plugin)
/setupOr manually:
# Install graphql-lsp server
npm install -g graphql-language-service-cli
# Install development tools
npm install -g prettier @graphql-eslint/eslint-pluginThe plugin configures graphql-lsp for Claude Code via .lsp.json:
{
"graphql": {
"command": "graphql-lsp",
"args": ["server", "-m", "stream"],
"extensionToLanguage": {
".graphql": "graphql",
".gql": "graphql"
},
"transport": "stdio"
}
}Capabilities:
- Go to definition / references
- Hover documentation
- Schema validation
- Query/mutation validation
- Auto-completion for types and fields
- Real-time diagnostics
- Fragment reference support
All hooks run afterWrite and are configured in hooks/hooks.json.
| Hook | Trigger | Description |
|---|---|---|
graphql-format-on-edit |
**/*.graphql,*.gql |
Auto-format with Prettier |
graphql-validate |
**/*.graphql,*.gql |
Validate queries against schema |
graphql-lint |
**/*.graphql,*.gql |
Lint with graphql-eslint |
| Hook | Trigger | Description |
|---|---|---|
graphql-security-check |
**/*.graphql,*.gql |
Detect deep nesting and complexity issues |
graphql-todo-fixme |
**/*.graphql,*.gql |
Surface TODO/FIXME comments |
| Hook | Trigger | Description |
|---|---|---|
graphql-schema-check |
**/schema.graphql |
Validate schema syntax |
json-validate |
**/*.json |
Validate GraphQL config files |
| Tool | Installation | Purpose |
|---|---|---|
graphql-lsp |
npm install -g graphql-language-service-cli |
LSP server |
graphql |
npm install -g graphql |
GraphQL runtime |
| Tool | Installation | Purpose |
|---|---|---|
prettier |
npm install -g prettier |
Formatting |
@graphql-eslint/eslint-plugin |
npm install -g @graphql-eslint/eslint-plugin |
Linting |
| Tool | Installation | Purpose |
|---|---|---|
@graphql-codegen/cli |
npm install -g @graphql-codegen/cli |
Code generation |
graphql-inspector |
npm install -g @graphql-inspector/cli |
Schema diff and validation |
graphql-lsp/
├── .claude-plugin/
│ └── plugin.json # Plugin metadata
├── .lsp.json # graphql-lsp configuration
├── commands/
│ └── setup.md # /setup command
├── hooks/
│ ├── hooks.json # Hook definitions
│ └── scripts/
│ └── graphql-hooks.sh
├── tests/
│ └── sample.graphql # Sample schema
├── CLAUDE.md # Project instructions
└── README.md # This file
- Ensure
.graphqlrcorgraphql.config.jsexists in project root - Verify installation:
graphql-lsp --version - Check LSP config:
cat .lsp.json
- Ensure schema file is specified in
.graphqlrc - Verify schema syntax with
graphql-inspector validate
MIT