Registry / devops / grpc-graphql

grpc-graphql

JSON →
library1.0.10jsnpmunverified

A minimal library that exposes a gRPC endpoint to execute GraphQL queries via remote procedure calls. Current version 1.0.10, low release cadence. Provides a simple server and client for sending GraphQL requests over gRPC, with basic insecure credentials support. Differentiates by bridging GraphQL queries into a gRPC service with minimal configuration, but lacks extensive documentation and error handling.

npm install grpc-graphql
INSTALL
IMPORT
SIG · GRPC-GRAPHQL
G
grpc-graphql
devopsjavascriptv1.0.10
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

server
import { server } from 'grpc-graphql'
const server = require('grpc-graphql').server
Default export is an object with 'app', 'server', 'client' properties. ESM and CJS both supported.
client
import { client } from 'grpc-graphql'
Client constructor expects URL and credentials. Use 'credentials.createInsecure()' from grpc package.
app
import { app } from 'grpc-graphql'
App function sets up the server. Takes port and graphql handler.

Shows server and client setup for gRPC GraphQL: start server on port 50051, then send a GraphQL query from client.

const { app } = require('grpc-graphql'); const { server, credentials } = require('grpc'); // Server side const graphqlHandler = (req, callback) => { const query = req.query; callback(null, { data: 'result' }); }; app({ port: 50051, graphql: graphqlHandler }); // Client side const { client } = require('grpc-graphql'); const clientInstance = new client('localhost:50051', credentials.createInsecure()); clientInstance.callRequest({ query: '{ user { name } }' }, (err, response) => { if (err) console.error(err); else console.log(response); });
Debug
Known issues
gotchaThe library does not parse GraphQL queries; it only passes the query string to the handler.
fix
Implement your own GraphQL execution logic inside the handler (e.g., use graphql package).
affects: >=1.0.0
gotchaThe 'client' class uses insecure credentials by default; not suitable for production.
fix
Use secure credentials like 'credentials.createSsl()' from the grpc package.
affects: >=1.0.0
deprecatedThe 'grpc' package (node-grpc) is deprecated; use '@grpc/grpc-js' instead.
fix
Migrate to '@grpc/grpc-js' and update import paths accordingly.
affects: >=1.0.0
Errors
Common errors & fixes
Cannot find module 'grpc'
Missing grpc dependency
fix
npm install grpc
TypeError: server is not a constructor
Incorrect import of server
fix
Use 'const { server } = require('grpc');' instead of 'const server = require('grpc');'
Upgrade
Version history
1.0.10latest on npm
Audit
Dependencies
graphqlrequiredcore dependency for GraphQL query execution
grpcrequiredgRPC library for client-server communication
Agent activity
6 hits · last 30 days
node
6
Resources
grpc-graphql — npm install grpc-graphql · libregistry