Skip to main content
The Graphman GraphQL API provides programmatic access to Graph Node management operations. It offers an alternative to the CLI for deployment management, status monitoring, and administrative tasks.

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
The Graphman server should never be exposed externally. It provides privileged operations that could severely impact your indexer if accessed by an attacker.

Configuration

The Graphman GraphQL server is only started when the GRAPHMAN_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 the Authorization 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:
  1. Open the playground in your browser
  2. Locate the HTTP Headers section at the bottom of the page
  3. Add the authorization header:
The playground is the best place to explore the full schema, available queries and mutations, and their documentation.

Available Operations

Deployment Info

Retrieve detailed information about one or multiple deployments.

Deployment Selection

You can query deployments using different selectors:

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 FAILED
number
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

Pause deployments during planned maintenance or RPC provider changes:
Temporarily pause resource-intensive subgraphs during high-load periods:
Pause a deployment to investigate issues without affecting other subgraphs:
A deployment cannot be paused if it’s already in a paused state. Check the isPaused field before attempting to pause.

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 (like restart) execute asynchronously in the background. These operations:
  1. Return immediately with a unique execution ID
  2. Execute in the background
  3. Can be monitored using the execution.info query

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

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
Change your GRAPHMAN_SERVER_AUTH_TOKEN periodically:
Generate cryptographically secure tokens:
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
  • 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

Solution: Verify your Authorization header includes the correct token.
Solution: Check the deployment hash or name is correct using the info query.
Solution: Check current status before attempting pause/resume operations.
Solution: Verify the execution ID is correct. Execution records may expire after completion.

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.
Operations being considered for future releases:
  • Deployment assignment and unassignment
  • Unused deployment management
  • Chain block verification
  • Call cache management
  • Bulk operations on multiple deployments
Check the GraphQL playground regularly to discover new features as they become available.

See Also