-
Notifications
You must be signed in to change notification settings - Fork 0
/
apis_beyond_rest_graphql.slide
103 lines (64 loc) · 2 KB
/
apis_beyond_rest_graphql.slide
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
APIs beyond REST: GraphQL
Omar Mekky
Software Craftsman
@cousine
https://github.com/cousine
* Hi there!
.image assets/introduction.gif 500 _
: introducing myself, experience and some ice breaking
: programmer since I was 13
: moved into web development in 2003
: college dropout
* Hi there!
.image assets/jumbo.jpg 500 _
: cat lover
: have cats
* Hi there!
.image assets/cats.jpg 500 _
: have a lot of cats
: talk to me after if you want to adopt
* Hi there!
.image assets/falafilo.jpg 500 _
: dog lover (recently), just the one dog
* Technical stuff
.image assets/logos.png 500 _
: co-founded mash, Ltd. in 2008
: working with Rails since 2008
: published in Rails Magazine twice
: author of Authentasaurus and Mebla for ElasticSearch
: Egypt On Rails
: Ruby & Rails evangelist
: teaching Rails exclusevly for 3 years CareerFoundry + Almakinah
* The issue with REST
- Multiple endpoints
- Requires versioning
- Requires team co-ordination to properly design
- No types
- Provider enforces naming on consumer
- Overall: not flexible
* What is GraphQL?
.image assets/GraphQL_Logo.svg 500 _
: A query language for APIs developed by Facebook for their GraphAPI
: Structured; you define a schema
: Typed
: One endpoint to query
: No versioning required
: You ask for what you need
: Who uses GraphQL?
* How it looks like on the provider side
.code src/graphql_schema.schema
* How it looks like on the consumer side
.code src/graphql_query.query /REGULAR/,/END REGULAR/
.code src/graphql_results.results /REGULAR/,/END REGULAR/
* What if we only want the author and published_at?
.code src/graphql_query.query /VARIATION/,/END VARIATION/
.code src/graphql_results.results /VARIATION/,/END VARIATION/
* What if we want to rename a field?
.code src/graphql_query.query /RENAME/,/END RENAME/
.code src/graphql_results.results /RENAME/,/END RENAME/
* Enough talk, Demo time!
.image assets/ready.gif 300 _
* Questions
- Slides for this talk at
.link https://github.com/cousine/talks-presentations