1.2 KiB
1.2 KiB
axum-async-graphql
Setup and Running
-
Copy
.env_devto.envfor local development:cp .env_dev .env -
Update database connection string in
.envfile as needed -
Run the application:
cargo run -
Access GraphiQL IDE at: "http://localhost:8000"
Development Commands
- Run tests:
cargo test - Format code:
cargo fmt - Check types:
cargo check - Lint:
cargo clippy
Architecture
This is a Rust application using:
axumfor web frameworkasync-graphqlfor GraphQL implementationsqlxfor database access- PostgreSQL as the database
The structure follows domain-driven design with separate modules for:
domain- core business logic and entitiesqueries- GraphQL query resolversmutations- GraphQL mutation resolversdataloader- data loading optimizationmodels- shared data models
Key Files
src/main.rs- Entry point and application setupsrc/database.rs- Database connection managementsrc/config.rs- Configuration handlingsrc/domain/- Core business logic modules
Testing
Integration tests can be run via the test script:
./test.sh
The test script contains example mutations to test the API.