Registry / http-networking / apollo-language-server

apollo-language-server

JSON →
library1.26.9jsnpmunverified

The Apollo Language Server is a deprecated JavaScript/TypeScript package designed to provide advanced language features for Apollo GraphQL projects within integrated development environments (IDEs). Last actively maintained at version 1.26.9 and published approximately four years ago, it aimed to offer capabilities such as syntax highlighting, real-time validation, autocompletion, and schema navigation for GraphQL files and embedded GraphQL templates. Its core functionality has since been integrated directly into the official Apollo GraphQL VS Code extension and other Apollo tooling, rendering this standalone package largely obsolete for modern development. As such, it is no longer actively developed or recommended for new projects, with its primary function superseded by a more integrated editor experience. Developers should utilize the VS Code extension for current Apollo GraphQL language support.

npm install apollo-language-server
INSTALL
IMPORT
SIG · APOLLO-LANGUAGE-SE
A
apollo-language-server
http-networkingjavascriptv1.26.9
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Not applicable for direct application import
// The apollo-language-server package is designed to be run as a standalone process // and communicates via the Language Server Protocol (LSP) over stdin/stdout. // It is not typically imported as a library into other JavaScript/TypeScript applications. // Instead, editor extensions (like the Apollo GraphQL VS Code extension) invoke it as a child process.
This package is an implementation of a Language Server, meant to be executed as a process (e.g., `node ./node_modules/apollo-language-server/lib/index.js`) and communicate via the Language Server Protocol. It does not expose symbols for direct programmatic import into typical application code.

This quickstart illustrates how a host application or editor extension might start and communicate with the Apollo Language Server as an external process using the Language Server Protocol (LSP). It simulates sending an 'initialize' request, which is the first message an LSP client sends to a server. This package is not designed for direct application imports, as its functionality is consumed by editor extensions.

/* This quickstart demonstrates how a Language Server Protocol (LSP) client, such as an IDE extension, might theoretically invoke the apollo-language-server as a child process. Direct programmatic use of this package in a typical application is not intended or recommended, especially given its deprecated status. Users seeking Apollo GraphQL language features should install the official 'Apollo GraphQL' VS Code extension or similar editor integrations. */ import { spawn } from 'child_process'; import path from 'path'; const languageServerPath = path.resolve( __dirname, 'node_modules', 'apollo-language-server', 'lib', 'index.js' ); const languageServerProcess = spawn( 'node', [languageServerPath], { stdio: ['pipe', 'pipe', 'pipe'] } ); languageServerProcess.stdout.on('data', (data) => { console.log(`LSP Server stdout: ${data}`); // In a real LSP client, this data would be parsed as LSP messages // and used to update editor features (diagnostics, completions, etc.) }); languageServerProcess.stderr.on('data', (data) => { console.error(`LSP Server stderr: ${data}`); }); languageServerProcess.on('close', (code) => { console.log(`LSP Server process exited with code ${code}`); }); // Example: Sending an initialize request (simplified, actual LSP has headers) const initializeRequest = { jsonrpc: '2.0', id: 1, method: 'initialize', params: { processId: process.pid, rootUri: `file://${process.cwd()}`, capabilities: { /* client capabilities here */ } } }; function sendLSPMessage(message: any) { const content = JSON.stringify(message); const contentLength = Buffer.byteLength(content, 'utf8'); const header = `Content-Length: ${contentLength}\r\nContent-Type: application/json\r\n\r\n`; languageServerProcess.stdin.write(header + content); } // In a real client, you'd send more messages (didOpen, didChange, etc.) // For this quickstart, we'll just demonstrate starting and sending one message. // In a real scenario, there would be a full LSP communication loop. // To prevent the example from hanging indefinitely in a CI environment setTimeout(() => { console.log('Terminating example LSP client after some time.'); languageServerProcess.kill(); }, 5000);
Debug
Known issues
breakingThe `apollo-language-server` package is deprecated and no longer actively maintained. Its functionality has been integrated into the 'Apollo GraphQL' VS Code extension and other Apollo tooling. New projects should not rely on this package directly.
fix
Migrate to the official 'Apollo GraphQL' VS Code extension (or corresponding IDE integration) for current GraphQL language features and support. If programmatic GraphQL tooling is required, explore `@apollo/server` for server implementations or `@graphql-tools/*` for schema utilities.
affects: >=1.26.9
gotchaThis package is an implementation of a Language Server and is intended to be run as a separate process (e.g., by an editor extension) communicating via stdin/stdout using the Language Server Protocol. It is not designed to be imported as a library for direct programmatic use within application code.
fix
Do not attempt to `import` and use symbols from `apollo-language-server` in your application. Instead, install the Apollo GraphQL VS Code extension or understand that your IDE uses a bundled or separately installed language server process.
affects: >=1.0.0
gotchaOlder versions of the Apollo Language Server, particularly when dealing with large or complex GraphQL projects, have been reported to exhibit slow performance for features like 'Go to Definition' or general IntelliSense suggestions, especially on Windows.
fix
Ensure you are using the latest available version (1.26.9), though active maintenance has ceased. For optimal performance and features, use the actively developed Apollo GraphQL VS Code extension which incorporates more recent optimizations and updated tooling.
affects: <1.26.0
Errors
Common errors & fixes
Cannot find module 'apollo-language-server/lib/index.js'
The language server is typically invoked as a child process by an editor extension, not directly imported. This error may occur if an LSP client attempts to load the module incorrectly or if the package is not correctly installed.
fix
Ensure `apollo-language-server` is installed in your project's `node_modules`. If you are trying to use it programmatically as a library, reconsider your approach; it is designed as a standalone process. For editor features, install the Apollo GraphQL VS Code extension.
Error: GraphQL service is not running. Please restart VS Code.
This error typically indicates that the language server process failed to start or crashed, which is often managed by the VS Code extension. It can be due to corrupted caches, misconfigurations, or conflicts.
fix
Restart VS Code. If the issue persists, try clearing the VS Code cache, ensuring your `apollo.config.js` or `apollo.config.json` file is correctly configured at your project root, and checking the VS Code output panel for 'Apollo GraphQL' for more specific error messages. Ensure your Node.js version meets the `engines` requirement (>=8).
Upgrade
Version history
1.26.9latest on npm
Audit
Dependencies
vscode-languageserverrequiredCore dependency for implementing the Language Server Protocol.
graphqlrequiredFundamental dependency for GraphQL schema parsing and validation.
cosmiconfigrequiredUsed for loading configuration files from various sources.
Agent activity
21 hits · last 30 days
node
18
OpenAI (training)
1
Resources
apollo-language-server — npm install apollo-language-server · libregistry