hasura/graphql-engine
Blazing fast, instant realtime GraphQL APIs on all your data with fine grained access control, also trigger webhooks on database events.
Hasura GraphQL Engine - instant GraphQL APIs on databases with access control
GraphQL queries flow through the engine's parser, validator, and executor, with metadata controlling schema generation and permissions, while CLI tools manage database migrations and deployments
Under the hood, the system uses 3 feedback loops, 4 data pools, 4 control points to manage its runtime behavior.
Structural Verdict
A 10-component fullstack with 4 connections. 4462 files analyzed. Loosely coupled — components are relatively independent.
How Data Flows Through the System
GraphQL queries flow through the engine's parser, validator, and executor, with metadata controlling schema generation and permissions, while CLI tools manage database migrations and deployments
- Schema Introspection — Engine reads database schema and generates GraphQL types (config: services.postgres.environment.POSTGRES_DB)
- Query Processing — Incoming GraphQL queries are parsed, validated, and planned for execution
- Permission Enforcement — Role-based access control filters queries based on metadata configuration
- Database Execution — Optimized SQL queries are executed against connected databases (config: services.postgres.ports)
- Response Assembly — Results are formatted as GraphQL responses with real-time subscription support
System Behavior
How the system actually operates at runtime — where data accumulates, what loops, what waits, and what controls what.
Data Pools
Tracks applied database migrations and current schema version
Stores GraphQL schema definitions, permissions, and configuration
Compressed XML test data with JSON schemas for connector testing
Browser localStorage storing UI preferences and transformation configs
Feedback Loops
- Migration Retry Loop (retry, balancing) — Trigger: Failed migration operation. Action: Retry with exponential backoff. Exit: Success or max retries reached.
- Schema Refresh Loop (polling, balancing) — Trigger: Database schema changes. Action: Reload GraphQL schema from database introspection. Exit: Schema stabilizes.
- Configuration Validation (circuit-breaker, balancing) — Trigger: Invalid configuration detected. Action: Reject requests until config is fixed. Exit: Valid configuration provided.
Delays & Async Processing
- Migration Execution Window (async-processing, ~variable) — Database unavailable during schema changes
- Console Asset Loading (cache-ttl, ~browser-dependent) — Initial console load time
- Data Connector Response (async-processing, ~database-dependent) — Query response time varies by connector performance
Control Points
- Migration Mode (env-var) — Controls: Whether migrations run automatically or require manual approval. Default: migration_mode setting
- Console Mode (env-var) — Controls: OSS, Pro, or Cloud console features and endpoints. Default: consoleMode
- Telemetry Toggle (env-var) — Controls: Whether usage analytics are collected. Default: enableTelemetry
- Database Connection (env-var) — Controls: PostgreSQL connection parameters and credentials. Default: POSTGRES_DB=hasura
Technology Stack
Core GraphQL engine implementation
CLI tools and migration management
Data connectors and frontend console
Web console user interface
Primary database support
API query language and schema definition
Container orchestration and development
HTTP server framework for data connectors
Code editor component in console
HTTP router for CLI API endpoints
Key Components
- migrate.Migrate (service) — Handles database migration operations through HTTP API endpoints
cli/migrate/api/migrate.go - projectmetadata.Handler (service) — Manages metadata import/export operations for GraphQL schema definitions
cli/migrate/api/metadata.go - Config (config) — Defines configuration schema for SQLite data connector with database path and table filtering
dc-agents/sqlite/src/config.ts - StaticData (model) — Loads and processes XML data files with corresponding JSON schemas for reference implementation
dc-agents/reference/src/data/index.ts - RequestTransformState (utility) — Manages transformation configurations for HTTP requests and responses in webhooks
frontend/libs/console/legacy-ce/src/lib/components/Common/ConfigureTransformation/utils.ts - Globals (config) — Central configuration object containing environment-specific settings for console modes
frontend/libs/console/legacy-ce/src/lib/Globals.ts - Expression (type-def) — Union type defining all possible GraphQL query expression types for filtering
dc-agents/dc-api-types/src/models/Expression.ts - cli-ext command handler (cli-command) — Routes CLI extension commands to appropriate service handlers for SDL and Actions codegen
cli-ext/src/command.ts - BaseEditor (component) — React wrapper around Ace Editor with Hasura-specific configuration and theming
frontend/libs/console/legacy-ce/src/lib/components/Common/AceEditor/BaseEditor.tsx - endpoints (config) — Centralizes all API endpoint URLs for GraphQL, metadata, migrations, and external services
frontend/libs/console/legacy-ce/src/lib/Endpoints.ts
Sub-Modules
Command-line interface for project management, migrations, and metadata operations
React-based administrative interface for managing GraphQL schemas and databases
Reference implementation and test fixtures for data connector protocol
Extended CLI functionality for code generation and schema management
Next-generation GraphQL engine with enhanced connector support
Configuration
docker-compose.yaml (yaml)
name(string, unknown) — default: hge-manual-testsservices.postgres.extends.file(string, unknown) — default: docker-compose/databases.yamlservices.postgres.extends.service(string, unknown) — default: postgresservices.postgres.ports(array, unknown) — default: 65002:5432services.postgres.environment.POSTGRES_USER(string, unknown) — default: hasuraservices.postgres.environment.POSTGRES_PASSWORD(string, unknown) — default: hasuraservices.postgres.environment.POSTGRES_DB(string, unknown) — default: hasuraservices.postgres.volumes(array, unknown) — default: postgres-data:/var/lib/postgresql,./docker-compose/postgres/init.sh:/docker-entrypoint-initdb.d/init-hasura.sh:ro- +25 more parameters
sample.hie.yaml (yaml)
cradle.cabal(array, unknown) — default: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
contrib/metadata-types/generated/HasuraMetadataV2.py (python-dataclass)
name(str, unknown)value(str, unknown)
contrib/metadata-types/generated/HasuraMetadataV2.py (python-dataclass)
name(str, unknown)value_from_env(str, unknown)
Explore the interactive analysis
See the full architecture map, data flow, and code patterns visualization.
Analyze on CodeSeaRelated Fullstack Repositories
Frequently Asked Questions
What is graphql-engine used for?
Hasura GraphQL Engine - instant GraphQL APIs on databases with access control hasura/graphql-engine is a 10-component fullstack written in TypeScript. Loosely coupled — components are relatively independent. The codebase contains 4462 files.
How is graphql-engine architected?
graphql-engine is organized into 5 architecture layers: GraphQL Engine Core, Web Console, CLI Tools, Data Connectors, and 1 more. Loosely coupled — components are relatively independent. This layered structure keeps concerns separated and modules independent.
How does data flow through graphql-engine?
Data moves through 5 stages: Schema Introspection → Query Processing → Permission Enforcement → Database Execution → Response Assembly. GraphQL queries flow through the engine's parser, validator, and executor, with metadata controlling schema generation and permissions, while CLI tools manage database migrations and deployments This pipeline design reflects a complex multi-stage processing system.
What technologies does graphql-engine use?
The core stack includes Haskell (Core GraphQL engine implementation), Go (CLI tools and migration management), TypeScript (Data connectors and frontend console), React (Web console user interface), PostgreSQL (Primary database support), GraphQL (API query language and schema definition), and 4 more. This broad technology surface reflects a mature project with many integration points.
What system dynamics does graphql-engine have?
graphql-engine exhibits 4 data pools (Migration State, Metadata Store), 3 feedback loops, 4 control points, 3 delays. The feedback loops handle retry and polling. These runtime behaviors shape how the system responds to load, failures, and configuration changes.
What design patterns does graphql-engine use?
5 design patterns detected: Data Connector Protocol, Migration API Pattern, Console Plugin Architecture, CLI Extension System, Multi-Version Support.
Analyzed on March 31, 2026 by CodeSea. Written by Karolina Sarna.