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 (reused from v1)
- Compiler: GraphQL schema → SQL template compiler (new for v2)
- Runtime: Compiled query executor (new for v2)
- Database: Connection pooling and transaction management (from v1)
- Cache: Query result caching with coherency (from v1)
- Security: Authentication, authorization, and audit (from v1)
- APQ: Automatic Persisted Queries (from v1)
§Compilation Flow
Python/TypeScript Decorators
↓
JSON Schema
↓
Compiler
↙ ↓ ↘
Parse Validate Codegen
↓
CompiledSchema.json
↓
Runtime
↙ ↓ ↘
Match Execute Project
↓
GraphQL Response§Example
ⓘ
use fraiseql_core::schema::CompiledSchema;
use fraiseql_core::runtime::Executor;
// Load compiled schema
let schema = CompiledSchema::from_file("schema.compiled.json")?;
// Create executor
let executor = Executor::new(schema, db_pool).await?;
// 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 error::FraiseQLError;pub use error::Result;pub use schema::CompiledSchema;pub use tenancy::TenantContext;
Modules§
- apq
- Automatic Persisted Queries (APQ) infrastructure.
- audit
- Audit logging infrastructure
- cache
- Query result caching for FraiseQL v2.
- compiler
- Schema compiler for FraiseQL v2.
- config
- Configuration management.
- db
- Database abstraction layer.
- design
- Design Quality Analysis Engine
- error
- Error types for
FraiseQLcore. - federation
- Federation support for Apollo Federation v2.
- filters
- Rich type filter operators and handlers.
- graphql
- GraphQL parsing and query processing.
- observability
- Observability and monitoring infrastructure.
- 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.