Expand description
§FraiseQL Core
Core execution engine for FraiseQL v2 - A compiled GraphQL execution engine.
§Architecture
FraiseQL v2 compiles GraphQL schemas into optimized SQL execution plans at build time, eliminating runtime overhead and enabling deterministic, high-performance query execution.
§Key Components
- Schema: Compiled schema representation (types, fields, SQL mappings)
- Compiler: GraphQL schema → SQL template compiler
- Runtime: Compiled query executor
- Database: Connection pooling and transaction management
- Cache: Query result caching with coherency
- Security: Authentication, authorization, and audit
- APQ: Automatic Persisted Queries
§Compilation Flow
Python/TypeScript Decorators
↓
JSON Schema
↓
Compiler
↙ ↓ ↘
Parse Validate Codegen
↓
CompiledSchema.json
↓
Runtime
↙ ↓ ↘
Match Execute Project
↓
GraphQL Response§Example
// Requires: a compiled schema file and a live PostgreSQL database.
// See: tests/integration/ for runnable examples.
use fraiseql_core::schema::CompiledSchema;
use fraiseql_core::runtime::Executor;
use fraiseql_core::db::postgres::PostgresAdapter;
use std::sync::Arc;
// Load compiled schema
let schema = CompiledSchema::from_json(schema_json)?;
// Create executor (db_pool is a DatabaseAdapter implementation)
let db_pool = Arc::new(PostgresAdapter::new("postgresql://localhost/mydb").await?);
let executor = Executor::new(schema, db_pool);
// Execute query
let query = r#"query { users { id name } }"#;
let result = executor.execute(query, None).await?;
println!("{}", result);Re-exports§
pub use config::FraiseQLConfig;pub use schema::CompiledSchema;pub use tenancy::TenantContext;pub use fraiseql_db as db;
Modules§
- apq
- Automatic Persisted Queries (APQ) infrastructure.
- cache
- Query result caching for FraiseQL v2.
- compiler
- Schema compiler for FraiseQL v2.
- config
- Configuration management.
- error
- Error types for FraiseQL core.
- filters
- Rich type filter operators and handlers.
- graphql
- GraphQL parsing and query processing.
- http
- HTTP utilities for outbound requests.
- prelude
- Convenience re-exports for the most commonly used fraiseql-core types.
- runtime
- Runtime query executor - executes compiled queries.
- schema
- Compiled Schema Types
- security
- Security features
- tenancy
- Multi-tenancy support for FraiseQL
- types
- Type-safe identifiers and domain types for FraiseQL
- utils
- Utility modules for FraiseQL.
- validation
- Input validation module.
Enums§
- FraiseQL
Error - Main error type for FraiseQL operations.
Constants§
Type Aliases§
- Result
- Result type alias for FraiseQL operations.