GraphQL: Schema first or Code first ๐ค
TL;DR
- GraphQL ใฏไธ่ฝใงใฏใชใ
- Code first ใใใๅฐใ็ด ๆฏใใใ
Graph QL
- GraphQL ใฎใตใผใใผๅฎ่ฃ ใใงใใชใใ NestJS ใ็ด ๆฏใใใฆใใ
- Swagger ็ญใง Definition ใ็ฎก็ใใๆฉไผใๆฐๅบฆ็ต้จใใใใณใผใใจใฎไน้ขใ่ฆใใ
- Code first ใพใง่จใใใจใใใ็จๅบฆๅใไธ่ดใใฆใปใใ
- ๅฅใซ Client ใฎใณใผใใพใง็ๆใใชใใฆใ่ฏใ๏ผใใใๅ่ณชใๆชใใใใใชใไฝฟใใชใ๏ผ
- Interface ใฏไน้ขใใชใใใใซใใใ
Must to have
- Frontend, Backend ๅ ฑ้ใฎใใฎใจใใฆ๏ผ็ๆนใใ๏ฝไธกๆน๏ผ็ๆใงใใ
- CI ใงไน้ขใๆค็ฅใงใใ
Want to have
- ๅฎ่ฃ ใๅ ่กใใชใ็ถๆ ใ่จฑๅฎนใงใใ๏ผSchema first)
- Generate ใใญใผใๅๆนๅ
- Apollo ใจใ State ็ฎก็ใพใง้ขๅ่ฆใๆฐใฟใใใฃใใ๏ผ
Nest + GraphQL
- Schema first or Code First ใ้ธๆใใฆๅฉ็จใงใใ
- Schema first ใงใฏๅฎ่ฃ ใ็ธใใชใๅคๆญใง Code First type-graphql ใงๅฎ่ฃ
- TypeORM ใฎใณใผใใใใฐใใใณใผใใ็ๆใงใใชใใจ่พใ => (่ฆๆค่จ๏ผ
- Service Class ใ CI ใใฆ ORM ใซใคใชใใฆใใใ๏ผ
- @next/graphql ใฏ่ใ wrapper ใงๅบๆฌ็ใซใฏ GraphQL ใๆ่ญใใใฐ่ฏใ๏ผ