simple graphql example
# server - http://localhost:4000
# playground - http://localhost:4000/graphql
yarn servergraphql/
├── entity
│ ├── index.ts
│ ├── review
│ │ ├── review.graphql
│ │ └── review.resolver.ts
│ └── user
│ ├── user.graphql
│ └── user.resolver.ts
├── index.ts
└── utils.ts
3 directories, 7 files
entityfolder- structured based on entity level abstraction
- has
GraphQL Type Definition - has
GraphQL Resolver
- has
- has posibillity of full graphql syntax support
- not
tsbut.graphqlfiles
- not
- expose
typeDefsandresolvers
- structured based on entity level abstraction
index.tsfile- expose executable schema through
makeExecutableSchemafunction
- expose executable schema through
- Focus on abstracted API
- API should be abstracted. It doesn't care about concrete implementation or product
- eg: GraphQL should not be affected by what database is used
- Focus on Graph Model
- Data should be consumed by entity level
- It means that normalizing data model is required.