| title | Quickstart: Create your first graph in Microsoft Fabric |
|---|---|
| description | Create a basic graph with two nodes and one edge in Microsoft Fabric in just a few minutes using the visual graph modeling experience. |
| ms.topic | quickstart |
| ms.date | 03/24/2026 |
| ms.reviewer | wangwilliam |
| ms.search.form | Quickstart - Create your first graph in Microsoft Fabric |
| ai-usage | ai-assisted |
[!INCLUDE feature-preview]
In this quickstart, you use graph in Microsoft Fabric to create a basic graph with two nodes and one edge, and then run a query. This process takes about 15 minutes.
For a comprehensive tutorial that covers the full Adventure Works data model and more advanced scenarios, see the graph tutorial.
Before you start this quickstart, verify that:
-
You have access to a Microsoft Fabric capacity (F2 or higher) or a Fabric trial.
-
A Fabric administrator enabled graph in your Fabric tenant. They enable this setting in the admin portal.
:::image type="content" source="./media/quickstart/tenant-enable-graph.png" alt-text="Screenshot of the admin portal showing the toggle to enable graph in your Fabric tenant." lightbox="./media/quickstart/tenant-enable-graph.png":::
-
You're a member of a Fabric workspace or have permission to create items in the workspace. For more information, see Workspaces in Microsoft Fabric.
[!IMPORTANT] Access management of the graph is restricted to the workspace that hosts it. Users outside of the workspace can't access the graph. Users within the workspace who have access to the underlying data in the lakehouse can model and query the graph.
Tip
If you don't see Graph model (preview) in the + New item menu, ask your Fabric administrator to enable graph in the admin portal.
To create your graph, first load sample data into a lakehouse in your Fabric workspace.
-
Go to the graph GQL example datasets on GitHub.
-
Select the adventureworks_docs_sample.zip file and download it to your local machine.
[!TIP] To download a file from GitHub, select the file, and then select the Download raw file icon.
-
Extract the downloaded adventureworks_docs_sample.zip file to a folder on your local machine.
[!TIP] In File Explorer, right-click the zip file and select Extract All, then choose a destination folder.
-
In Microsoft Fabric, select your workspace.
-
Select + New item.
-
Select Store data > Lakehouse.
-
Enter a name (for example, "AdventureWorksLakehouse"), clear the Lakehouse schemas option, and select Create.
[!IMPORTANT] Graph doesn't currently support lakehouses with lakehouse schemas enabled.
For this quickstart, you only need two tables: adventureworks_customers and adventureworks_orders. Upload the full sample data folder, and then load just these two tables.
Note
You can upload the entire folder if you plan on doing the full tutorial later or want to explore the additional data.
- In your lakehouse, hover over Files, select the ellipsis (...), and then select Upload > Upload folder.
- Browse to the extracted folder and upload it. This action uploads all the sample data files to your lakehouse.
- Expand Files and the uploaded folder to see the subfolders. For this quickstart, you only need to load two of them as tables.
- Hover over the adventureworks_customers subfolder, select the ellipsis (...), and choose Load to Tables > New table.
- Set the file type to Parquet and select Load.
- Repeat steps 4-5 for the adventureworks_orders subfolder.
-
In your Microsoft Fabric workspace, select + New item.
-
Select Analyze and train data > Graph model (preview).
:::image type="content" source="./media/quickstart/new-item-graph-model.png" alt-text="Screenshot showing the new item menu with the option to select Graph model (preview)." lightbox="./media/quickstart/new-item-graph-model.png":::
[!TIP] Alternatively, enter "graph" in the search box and press Enter to search for graph items.
-
Enter a name (for example, "MyFirstGraph") and select Create.
After creating the graph model, you're taken to the graph view where you can see the default mode is set to Model with Save, Get data, Add node, and Add edge buttons at the top.
To add data to your graph model, follow these steps in graph view:
-
Select Get data.
-
From the OneLake catalog, select your lakehouse with the Adventure Works data.
-
Select Add.
-
Select the adventureworks_customers and adventureworks_orders tables, and then select Load.
:::image type="content" source="./media/quickstart/get-data.png" alt-text="Screenshot showing the get data dialog with selected tables." lightbox="./media/quickstart/get-data.png":::
Now that your data is loaded, define your graph's structure by adding nodes and edges. In this quickstart, you add two node types (Customer and Order) and one edge type (purchases) to model the relationship between customers and their orders.
-
Select Add node.
-
Configure the first node:
- Label:
Customer - Mapping table: adventureworks_customers
- ID of mapping column: CustomerID_K
:::image type="content" source="./media/quickstart/node-add-customer.png" alt-text="Screenshot showing the add node to graph dialog." lightbox="./media/quickstart/node-add-customer.png":::
- Label:
-
Select Confirm.
-
Select Add node again.
-
Configure the second node:
- Label:
Order - Mapping table: adventureworks_orders
- ID of mapping column: SalesOrderDetailID_K
- Label:
-
Select Confirm.
-
Select Add edge.
-
Configure the edge:
- Label:
purchases - Mapping table: adventureworks_orders
- Source node:
Customer - Source mapping column: CustomerID_FK
- Target node:
Order - Target mapping column: SalesOrderDetailID_K
:::image type="content" source="./media/quickstart/edge-add-purchases.png" alt-text="Screenshot showing the add edge dialog." lightbox="./media/quickstart/edge-add-purchases.png":::
- Label:
-
Select Confirm.
-
Select Save to load the graph. Loading might take a few moments. When the graph loads successfully, you see the node and edge labels in the graph view canvas.
Run a GQL query to find the top five customers by order count.
-
Select Query mode.
:::image type="content" source="./media/quickstart/query-mode-code-editor.png" alt-text="Screenshot showing how to select query mode and the code editor." lightbox="./media/quickstart/query-mode-code-editor.png":::
-
Select Code editor from the top menu.
-
Enter the following GQL query in the input box:
MATCH (c:Customer)-[:purchases]->(o:`Order`) RETURN c.fullName AS customer_name, count(o) AS num_orders GROUP BY customer_name ORDER BY num_orders DESC LIMIT 5
-
Select Run query. You should see five rows listing customer names and their order counts, sorted from most to fewest orders.
The following image shows the GQL query and its results:
:::image type="content" source="./media/quickstart/code-editor-query-and-results.png" alt-text="Screenshot showing the result of running a GQL query." lightbox="./media/quickstart/code-editor-query-and-results.png":::
Congratulations! You created your first graph in Microsoft Fabric and ran a query against it.
- Graph tutorial - Build a complete graph with multiple nodes, edges, and queries.
- GQL language guide - Learn GQL syntax.
- What is graph in Microsoft Fabric? - Learn about graph concepts.