Source: https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/ddl/graph-type/rename/ Documentation version: v5.3.2 # RENAME GRAPH TYPE statement The RENAME GRAPH TYPE statement renames a graph type in the schema of the current session or a specified schema. Note An operation involving a non-default schema or an object in it requires access to the schema, either implicitly or through an explicit `USAGE` grant, as well as the privilege required for the operation. The schema access check and the privilege check for the requested operation are independent; satisfying one does not satisfy the other. Schema access control does not apply to temporary graphs or built-in procedures and functions. For more information, see [Schema access control](https://dev-docs.nebula-graph.io/v5.3.2/server-admin/authorization/schema-access-control/). ## Prerequisites - A graph type is created. For more information, see [CREATE GRAPH TYPE](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/ddl/graph-type/create/). - To rename a graph type, you must either be the owner of the graph type, be granted to perform the action `ALTER` on the graph type, or be granted to perform the action `ALTER ANY GRAPH TYPE` on the corresponding schema. For more information, see [Roles and privileges](https://dev-docs.nebula-graph.io/v5.3.2/server-admin/authorization/). ## Syntax diagramsource rename_graph_type_statement ```` rename_graph_type_statement ::= 'RENAME' 'PROPERTY'? 'GRAPH TYPE' (schema_reference '/')? old_graph_type_name 'TO' (schema_reference '/')? new_graph_type_name ```` ## Parameters ### `schema_reference` The reference to the path of the schema. It specifies the schema path of the graph type to be renamed here. - Both absolute and relative schema paths can be used in the statement. If you want to change the name of the graph type that is not in the schema of the current session, you must specify the schema path. For information about setting and viewing the schema, see [SESSION SET](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/sessions/set/) and [SHOW CURRENT_SCHEMA](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/data-admin/show/show-current-schema/). - The schema reference of the graph type cannot be changed. ### `old_graph_type_name` The current name of the graph type. ### `new_graph_type_name` The new name of the graph type. ## Examples The following examples are based on the [example dataset](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/overview/example-dataset/). ### Rename a graph type in the current schema ```` RENAME GRAPH TYPE movie_type TO movie_type_renamed ```` The preceding example renames the graph type `movie_type` to `movie_type_renamed`. ### Rename a graph type in the specified schema ```` RENAME GRAPH TYPE /default_schema/my_graph_type TO /default_schema/my_graph_type_renamed ```` The preceding example renames the graph type that is created in the Examples section of [CREATE GRAPH TYPE](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/ddl/graph-type/create/#create-a-graph-type-in-the-specified-schema) to `my_graph_type_renamed`.