Lessons Learned Migrating APIs to GraphQL ๐
--
This post shows best practices ๐ซ of migrating APIs to GraphQL. Add your thoughts, collabore asking/resolving concerns ๐ค, show them your folks, but ๐๐ป, share knowledge ๐
Lessons Learned
Modularize ๐ your typeDefs & resolvers ๐
โBreak your schema by concern, not by typesโโโโMartijn Walraven ๐
DRY โป๏ธ, use context! ๐
Evaluate whether your schema is feature or domain based ๐
Show whatโs important ๐ first ๐
Decouple global typeDefs! ๐
Take advantage ๐ of ESNext ๐
Return several types using Union Types!๐
Use Aliases ๐ฅ to rename the result of a field ๐
Donโt over-engineer, you can query with fetch๐
DRY โป๏ธ, use fragments!
Get rid off your variables using Input Types ๐
Extra ๐
Donโt miss the 1st part of a series resuming PayPalโs best practices for building GraphQL APIs ๐
Recapping
๐ Modularize ๐ your typeDefs & resolvers
๐ โBreak your schema by concern, not by typesโ โ Martijn Walraven
๐ DRY โป๏ธ, use context!
๐ Evaluate whether your schema is feature or domain based
๐ Show whatโs important ๐ first
๐ Decouple global typeDefs!
๐ Take advantage ๐ of ESNext
๐ Return several types using Union Types!
๐ Use Aliases ๐ฅ to rename the result of a field
๐ Donโt over-engineer, you can query with fetch
๐ DRY โป๏ธ, use fragments!
๐ Get rid off your variables using Input Types
โฆ
โญ๏ธ GraphQL Resolvers: Best Practices
Already waiting to add yours ๐ค, contribute adding more lessons learned ๐
Or even betterโฆ
Create posts ๐, courses ๐, meetups ๐, anything!, just be ๐ค and curious for teaching & learning ๐
Iโll be following this post up ๐ with more lessons learned, stay tuned!
Please, consider๐๐ปing, contributโป๏ธing and shar๐ing it!