Overview
The GraphQL API enables you to:- Query deployment information and status
- Pause and resume subgraph indexing
- Restart deployments
- Monitor long-running operations
- Integrate Graph Node management into your tooling
Configuration
The Graphman GraphQL server is only started when theGRAPHMAN_SERVER_AUTH_TOKEN environment variable is set.
Environment Variables
string
required
Authentication token for GraphQL requests. The server will not start without this variable.
number
default:"8050"
Port number for the GraphQL server
Example Configuration
Authentication
All GraphQL requests must include the authentication token in theAuthorization header:
GraphQL Playground
When the server is running, access the interactive GraphQL playground at:The playground port matches your
GRAPHMAN_PORT setting (default: 8050).Setting Up Authentication in Playground
To use the playground, you must configure the authorization header:- Open the playground in your browser
- Locate the HTTP Headers section at the bottom of the page
- Add the authorization header:
Available Operations
Deployment Info
Retrieve detailed information about one or multiple deployments.Deployment Selection
You can query deployments using different selectors:- By Hash
- By Name
- All Deployments
Status Fields
boolean
Whether the deployment is currently paused
boolean
Whether the deployment has synced to the current chain head
enum
Deployment health status:
HEALTHY, UNHEALTHY, or FAILEDnumber
The earliest indexed block number
object
The most recently indexed block
object
The current blockchain head block
Pause Deployment
Temporarily stops indexing for a deployment without removing any data.Use Cases
Maintenance Windows
Maintenance Windows
Pause deployments during planned maintenance or RPC provider changes:
Resource Management
Resource Management
Temporarily pause resource-intensive subgraphs during high-load periods:
Debugging
Debugging
Pause a deployment to investigate issues without affecting other subgraphs:
Resume Deployment
Resumes indexing for a previously paused deployment.Example Workflow
Restart Deployment
Pauses a deployment and automatically resumes it after a delay (default: 20 seconds). This is useful for forcing a fresh sync from a specific block.This is a long-running operation. The mutation returns immediately with an execution ID that you can use to track progress.
Tracking Execution Status
Use the returned execution ID to monitor the restart operation:Execution Status Values
status
Operation is queued but not yet started
status
Operation is currently executing
status
Operation completed successfully
status
Operation failed with an error
Polling for Completion
Long-Running Operations
Some operations (likerestart) execute asynchronously in the background. These operations:
- Return immediately with a unique execution ID
- Execute in the background
- Can be monitored using the
execution.infoquery
Benefits
Non-Blocking
Your client doesn’t need to maintain a long-lived connection
Resumable
You can disconnect and check status later using the execution ID
Transparent
Full visibility into operation progress and errors
Reliable
Operations continue even if the client disconnects
Integration Examples
Python
Node.js
cURL
Security Best Practices
Never Expose Externally
Never Expose Externally
The Graphman server should only be accessible from trusted internal networks:
- Bind to localhost (
127.0.0.1) only - Use firewall rules to restrict access
- Never expose to the public internet
- Consider using VPN or SSH tunnels for remote access
Rotate Tokens Regularly
Rotate Tokens Regularly
Change your
GRAPHMAN_SERVER_AUTH_TOKEN periodically:Use Strong Tokens
Use Strong Tokens
Generate cryptographically secure tokens:
Monitor Access
Monitor Access
Log all Graphman API access and monitor for suspicious activity:
- Track failed authentication attempts
- Monitor unusual operation patterns
- Alert on destructive operations
- Maintain audit logs
Principle of Least Privilege
Principle of Least Privilege
- Only grant Graphman API access to operators who need it
- Use separate tokens for different automation systems
- Implement token revocation when access is no longer needed
Error Handling
Common Errors
Authentication Failed
Authentication Failed
Authorization header includes the correct token.Deployment Not Found
Deployment Not Found
info query.Already Paused/Resumed
Already Paused/Resumed
Execution Not Found
Execution Not Found
Future Operations
Additional Graphman commands will be added to the GraphQL API over time. Always check the GraphQL playground for the latest schema and available operations.
- Deployment assignment and unassignment
- Unused deployment management
- Chain block verification
- Call cache management
- Bulk operations on multiple deployments
See Also
- Graphman CLI Commands - Command-line interface for Graph Node management
- Graph Node Configuration - Configuration file reference
- GraphQL Specification - GraphQL language specification

