directory
Version:
v1.0.1
Opens a new window with list of versions in this module.
Published: Aug 16, 2025
License: MIT
Opens a new window with license information.
README
¶
GraphQL Interface Layer
This directory contains the GraphQL interface layer implementation following Clean Architecture principles.
Structure
generated/ - Auto-generated GraphQL server code by gqlgen (DO NOT EDIT)
model/ - Auto-generated GraphQL model types (DO NOT EDIT)
resolver/ - GraphQL resolver implementations (manually maintained)
Generated Files
The following files are automatically generated by gqlgen and should not be edited manually:
generated/generated.go - Core GraphQL execution engine
model/models_gen.go - GraphQL type definitions as Go structs
Resolver Implementation
The resolver layer follows Clean Architecture by:
- Dependency Injection: The main
Resolver struct holds dependencies (logger, services)
- Thin Resolvers: Resolvers delegate business logic to application services
- Error Handling: Proper error mapping between domain/application errors and GraphQL errors
- Logging: Structured logging for all GraphQL operations
Current Status
- ✅ Basic resolver structure created
- ✅ Generated code compiles successfully
- ✅ Clean architecture patterns established
- ⏳ Application service integration (pending task 5)
- ⏳ Domain layer integration (pending task 4)
TODO
- Implement Time scalar with proper marshaling/unmarshaling
- Add application service dependencies when available
- Implement proper error mapping
- Add input validation
- Add context propagation for request tracing
Usage
To regenerate GraphQL code after schema changes:
go run github.com/99designs/gqlgen generate
Testing
Run resolver tests:
go test ./internal/interfaces/graphql/resolver/
Directories
¶
Click to show internal directories.
Click to hide internal directories.