simple graphql example
# server - http://localhost:4000
# playground - http://localhost:4000/graphql
yarn server
graphql/
├── entity
│ ├── index.ts
│ ├── review
│ │ ├── review.graphql
│ │ └── review.resolver.ts
│ └── user
│ ├── user.graphql
│ └── user.resolver.ts
├── index.ts
└── utils.ts
3 directories, 7 files
entity
folder- structured based on entity level abstraction
- has
GraphQL Type Definition
- has
GraphQL Resolver
- has
- has posibillity of full graphql syntax support
- not
ts
but.graphql
files
- not
- expose
typeDefs
andresolvers
- structured based on entity level abstraction
index.ts
file- expose executable schema through
makeExecutableSchema
function
- 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.