GraphQL directory structure discussion
Opened this issue · 1 comments
atange commented
egg-graphql
.
├── app
│ ├── graphql
| | ├── common
| | | └── directive.js // custom directives
│ │ ├── project
│ │ │ └── schema.graphql
│ │ ├── schemaDirectives
│ │ │ └── schemaDirective.js // custom SchemaDirective
│ │ │
│ │ └── user // a GraphQL model
│ │ ├── connector.js
│ │ ├── resolver.js
│ │ └── schema.graphql
│ ├── model
│ │ └── user.js
│ ├── public
│ └── router.js
graphql-joker
.
├── app
│ ├── graphql
| | ├── resolvers
| | | └── User.js
│ │ |── schemas
│ │ │ └── User.gql
├── models
| | └─User.js
victorteokw commented
Hi @sonong , there are some points on this.
- Connector is redundant and should be removed. This creates a layer of unnecessary encapsulation. And this is the main obstacle for coding automatically.
- The main discuss is about flat structure or per resource bias.
- I personally like flat structure.
- Joker is a generic tool. It will definitely support one directory per resource style in the future. Do you like to implement it? For now, it's hard to tweak Joker's behavior to create this style resolver path and schema path.