D2前端技术论坛

王啟安 Migrating to GraphQL

1. Migrating to GraphQL Chi-An Wang Jan 06 2019
2. Who Am I?
3. Who Am I? Frontend Engineer Lightweight Ad Experience Facebook @mw10104587 Chi-An Wang
4. Table of Contents ● ● ● ● ● ● ● ● Introduction to GraphQL Side by side comparison of REST VS GraphQL Why Did We Migrate Migration Some tips for Migration Some Result Examples Recap What's Next
5. Introduction to GraphQL
6. Introduction to GraphQL GraphQL is a query language for APIs and a runtime for fulfilling those queries with your existing data
7. Where is GraphQL? Plugging into current Web
8. Introduction to GraphQL JSON Object Style
9. Introduction to GraphQL You get only what you ask for
10. Introduction to GraphQL Request is still served through HTTP
11. Introduction to GraphQL
12. Introduction to GraphQL GraphQL is typed
13. Introduction to GraphQL Documentation and Exploration with GraphiQL
14. Introduction to GraphQL So Why “Graph” QL?
15. Introduction to GraphQL
16. Introduction to GraphQL
17. Introduction to GraphQL
18. Introduction to GraphQL
19. Why Did We Migrate to GraphQL?
20. Why Did We Migrate to GraphQL? Mobile First Using GraphQL prevents overfetching and reduces roundtrips
21. Why Did We Migrate to GraphQL? Consolidate Endpoints for Mobile and Web
22. Why Did We Migrate to GraphQL? Consolidate Endpoints for similar purpose
23. Why Did We Migrate to GraphQL? Better Typing
24. How?
25. How? Create a Schema
26. How?
27. How?
28. How? Implement the schema
29. How? ● C#/.NET ● ● ● ● ● ● Go Java PHP Javascript Python ...
30. How?
31. How?
32. How? Fill in Data
33. How?
34. How?
35. How?
36. How?
37. How?
38. How? Fill in Data with existing REST API
39. Some Tips
40. Some Tips Incrementally Migrate to GraphQL
41. Some Tips You don't need to have backend engineers to start this
42. Some Tips Think of your schema from your UI
43. Some Tips Prefer Object types over too many fields
44. Some Tips Prefer Object types over too many fields
45. Some Tips Use field parameters for different versions of the same field
46. Some Tips Use Global Unique ID Instead of specific DB ID
47. Some Tips Handle N+1 Problem With DataLoader ID
48. Some Results
49. Some Results Speed Up Development Speed So Fast Show this to your boss...
50. Recap
51. What's Next
52. What's Next ● Facebook ● ● ● ● ● ● ● Airbnb Apollo Coursera Github Shopify Twitter and more...
54. What's Next ● https://graphql.org ● https://www.apollographql.com/ ● Medium
55. Thank you Chi-An Wang Jan 06 2019

相关幻灯片