Source: https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/data-admin/set-user-graph/ Documentation version: v5.3.2 Deprecated This command has been deprecated. Please use [ALTER USER SET HOME_GRAPH](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/data-admin/alter-user/) to set the home graph for the current user. # SET USER GRAPH command The SET USER GRAPH command sets the home graph for the current user. To set the graph for the current session, use [SESSION SET](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/sessions/set/). ## Syntax diagramsource set_user_graph_command ```` set_user_graph_command ::= 'SET' 'USER' 'GRAPH' (schema_reference '/')? graph_name ```` ## Parameters ### `schema_reference` The reference to the path of the schema. It specifies the schema path of the graph to be set as the home graph for the user. Both absolute and relative schema paths can be used in the command. To set a graph that resides outside the schema in the current session as the home graph, the schema path must be specified. For information about setting and viewing the schema for the current session, 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/). ### `graph_name` The name of the graph to be set as the home graph. The name is case-sensitive and must match the name of an existing graph. You can use [CREATE GRAPH](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/ddl/graph/create/) to create a graph. ## Examples ### Set the graph in the current schema as the home graph ```` ''' // Create a graph type CREATE GRAPH TYPE IF NOT EXISTS home_graph_type AS {} ''' ''' // Create a graph CREATE GRAPH IF NOT EXISTS homegraph TYPED home_graph_type ''' ''' // Set the home graph for the current user SET USER GRAPH homegraph ''' ```` ### Set the graph in the specified schema as the home graph ```` ''' // Create a graph type CREATE GRAPH TYPE IF NOT EXISTS home_graph_type AS {} ''' ''' // Create a graph CREATE GRAPH IF NOT EXISTS homegraph TYPED home_graph_type ''' ''' // Create a schema CREATE SCHEMA IF NOT EXISTS /my_schema ''' ''' // Set the schema for the current session SESSION SET SCHEMA /my_schema ''' ''' // Set the home graph for the current user SET USER GRAPH /default_schema/homegraph ''' ```` ## More information - To view the information about the current user, use [SHOW CURRENT_USER](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/data-admin/show/show-current-user/). - To view the information about all users who are invited to the current service group, use [SHOW USERS](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/data-admin/show/show-users/). - To view the information about the current session, use [SHOW CURRENT_SESSION](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/data-admin/show/show-current-session/). - To view the information about all sessions, use [SHOW SESSIONS](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/data-admin/show/show-sessions/).