This repository contains examples of how to use the hugr platform for various use-cases, including setting up data sources, creating GraphQL schemas, and integrating with different services like PostgreSQL, Redis, and MinIO.
For more information about the hugr platform, please visit the Web site.
This repo contains examples of hugr use-cases.
To run the examples, you need to set up the environment. The examples are based on Docker and Docker Compose. To set up the environment, run the following command:
git clone git://git@github.com:hugr-lab/examples.git
cd examples
sh scripts/start.shTo down the environment, run:
sh scripts/stop.shThe environment contains the following services:
- PostgreSQL database
- MinIO object storage
- Redis
- Hugr server
- Prometheus for monitoring
- Grafana for visualization
Folder: get-started/
In this example we will set up a Northwind database on PostgreSQL and create GraphQL SDL schema for it.
In this example we will create an empty data PostgreSQL data base, describe it in GraphQL SDL and attach it into Hugr as a data source. Folder: postgres-examples/
Folder: mssql/
This example demonstrates how to use hugr with Microsoft SQL Server as a data source, featuring the Adventure Works Lightweight (LT) sample database. It showcases:
- MSSQL data source configuration with the
mssql://URI format - DuckDB MSSQL extension with projection and filter pushdown
- GraphQL schema patterns:
@table,@pk,@field_references - Hierarchical data (self-referencing categories)
- Many-to-many relationships (CustomerAddress junction table)
Note: Requires amd64 platform (Intel/AMD processor).
Folder: fabric-warehouse/
This example demonstrates how to use hugr with Microsoft Fabric Warehouse as a cloud data source, connecting via the azure:// URI scheme with Azure AD service principal authentication. It showcases:
- Fabric Warehouse connection via
azure://URI format with Azure AD credentials - Catalog-based schema loading with GraphQL SDL
@field_sourcedirective for simplifying column names in queries@field_referencesfor star schema relationships (7 dimension references on Trip)- GraphQL schema patterns:
@table,@pk,@field_source,@field_references - Filtering by relationships, aggregation, and bucket aggregation queries
- NYC taxi star schema: Date, Trip, Medallion, HackneyLicense, Geography, Time, Weather
Note: Requires an active Microsoft Fabric Warehouse instance with Azure AD service principal credentials.