tigergraph__update_schema
Apply incremental schema changes by adding or dropping vertex types, edge types, or attributes on a specific graph or globally.
Instructions
Apply incremental schema changes: add/drop vertex types, edge types, or individual attributes. Supports both local (graph-scoped) and global schema changes.
Use When:
Adding new vertex or edge types to an existing graph (local)
Creating global vertex/edge types shared across graphs (global)
Dropping vertex or edge types that are no longer needed
Adding or removing attributes on existing vertex types
Local schema change (add a vertex type to a graph):
{
"graph_name": "MyGraph",
"add_vertex_types": [{"name": "Product", "attributes": [{"name": "price", "type": "FLOAT"}]}]
}Global schema change (omit graph_name):
{
"add_vertex_types": [{"name": "SharedVertex", "attributes": [{"name": "val", "type": "INT"}]}]
}Tips:
Drop edges referencing a vertex type before dropping the vertex type
Adding attributes with defaults avoids null values on existing data
Use 'get_graph_schema' to inspect the current schema first
Omit 'graph_name' to apply changes at the global level
Related Tools: create_graph, get_graph_schema, show_graph_details
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| profile | No | Connection profile name. If not provided, uses TG_PROFILE env var or 'default'. | |
| graph_name | No | Name of the graph to modify. If not provided, runs a global schema change. | |
| add_edge_types | No | Edge type definitions to add (same format as create_graph). | |
| drop_edge_types | No | Names of edge types to drop. | |
| add_vertex_types | No | Vertex type definitions to add (same format as create_graph). | |
| drop_vertex_types | No | Names of vertex types to drop. | |
| add_vertex_attributes | No | Map of vertex type name to list of attributes to add. E.g. {"Person": [{"name": "score", "type": "FLOAT"}]} | |
| drop_vertex_attributes | No | Map of vertex type name to list of attribute names to drop. E.g. {"Person": ["old_attr"]} |