-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Description
I'm working on a Go project that utilizes a Feature-Based (also known as Domain-Driven Design or Vertical Slices) project structure. Our goal is for each feature (e.g., users, products, orders) to encapsulate all its related components, including GraphQL schema definitions, resolvers, models, and business logic.
A typical project structure for us looks like this:
.
├── go.mod
├── go.sum
├── main.go
└── internal/
├── app/ (main application setup)
├── config/
└── features/
├── users/
│ ├── graph/
│ │ ├── users.graphqls
│ │ ├── users.resolvers.go
│ │ └── users.models.go
│ ├── service/
│ │ └── users.go
│ └── repository/
│ └── users.go
├── products/
│ ├── graph/
│ │ ├── products.graphqls
│ │ ├── products.resolvers.go
│ │ └── products.models.go
│ ├── service/
│ └── repository/
└── orders/
├── graph/
│ ├── orders.graphqls
│ ├── orders.resolvers.go
│ └── orders.models.go
├── service/
└── repository/
How can gqlgen be instructed to generate resolvers and models directly into their respective feature-specific directories instead of a single top-level graph folder? For instance, I'd like users.resolvers.go and users.models.go to be generated within features/users/graph/
Metadata
Metadata
Assignees
Labels
No labels