π οΈAPI
Empower your integrations with the flexibility of GraphQL on Graph Commons.
The Graph Commons API provides developers with a powerful GraphQL interface to integrate, query, and manage data. With this API, you can automate processes, dive deep into your networks, and harness the full potential of Graph Commons directly from your applications.
GraphQL API Explorer
You can build queries, browse schemas, and test the API using the Apollo GraphQL Explorer:
ππΌ Open in Apollo Explorer

Authentication
No separate API key required, simply use your Graph Commons username and password to authenticate.
Hereβs a Node.js function to authenticate and retrieve a JWT token:
Create a graph
Use the login function from the authentication step to create a new graph.
Read a graph
Use the login function from the authentication step together with a graphIdβeither returned from the createGraph step or any existing graph on Graph Commonsβto fetch graph data.
Update a graph
You can update an existing graphβadding or removing nodes, edges, properties, or adjusting node positionsβusing the updateGraph mutation.
Call savePatchGraph(id, patch) to create new items and/or update graph properties (such as nodesPosition). The create section should use temporary IDs, which the server will map to permanent ones in the returned idsMapping.
Reset a graph
If you want to clear all nodes and edges while preserving the existing node/edge types and their colors, call resetGraph first. Then, use savePatchGraph with create blocks to re-populate the graph.
Tips & Gotchas
Temp IDs in creates: In
createGraphand thecreatesection ofsavePatchGraph, you can use any string IDs (e.g.,n_sam,et_works_at). The server returns anidsMappingto translate these to real IDs. Store them if youβll reference the same items later.Referencing existing items: When modifying existing nodes/edges, use the real IDs (from
idsMappingor from agetGraphByIdread).Positions: Set positions with either the temp node IDs (during
createGraph) or the real node IDs (when updating).Types vs. Instances:
nodeTypes/edgeTypesdefine the schema.nodes/edgesare your data. After a reset, types remain; nodes/edges are cleared.Errors: Always check
report.successand surfacereport.errorsin logs for faster debugging.
Next steps
Learn more about GraphQL queries
Explore queries and mutations in the Graph Commons API with the Apollo Explorer.
Last updated
Was this helpful?