preface |
|
xi | |
acknowledgments |
|
xii | |
About this book |
|
xiii | |
About the author |
|
xvi | |
About the cover illustration |
|
xvii | |
|
Part 1 Getting started with fuel stack GraphQL |
|
|
1 | (98) |
|
1 What is full stack GraphQL? |
|
|
3 | (26) |
|
1.1 A look at full stack GraphQL |
|
|
3 | (2) |
|
|
5 | (10) |
|
|
5 | (2) |
|
|
7 | (3) |
|
|
10 | (2) |
|
|
12 | (1) |
|
|
13 | (2) |
|
|
15 | (3) |
|
|
16 | (1) |
|
|
16 | (1) |
|
|
16 | (2) |
|
|
18 | (1) |
|
|
18 | (1) |
|
|
18 | (1) |
|
|
18 | (5) |
|
Property graph data model |
|
|
19 | (1) |
|
|
19 | (1) |
|
|
20 | (3) |
|
1.6 How it all fits together |
|
|
23 | (4) |
|
React and Apollo Client: Making the request |
|
|
24 | (1) |
|
Apollo Server and GraphQL backend |
|
|
25 | (1) |
|
React and Apollo Client: Handling the response |
|
|
26 | (1) |
|
1.7 What we will build in this book |
|
|
27 | (1) |
|
|
28 | (1) |
|
2 Graph thinking with GraphQL |
|
|
29 | (20) |
|
2.1 Your application data is a graph |
|
|
30 | (1) |
|
|
31 | (10) |
|
API modeling with type definitions: GraphQL-first development |
|
|
31 | (6) |
|
Resolving data with resolvers |
|
|
37 | (1) |
|
|
38 | (3) |
|
2.3 Combining type definitions and resolvers with Apollo Server |
|
|
41 | (6) |
|
|
41 | (1) |
|
|
42 | (1) |
|
|
43 | (3) |
|
Querying using Apollo Studio |
|
|
46 | (1) |
|
|
47 | (2) |
|
|
49 | (18) |
|
|
50 | (1) |
|
3.2 Graph data modeling with Neo4j |
|
|
50 | (4) |
|
|
51 | (3) |
|
Database constraints and Indexes |
|
|
54 | (1) |
|
3.3 Data modeling considerations |
|
|
54 | (1) |
|
|
54 | (1) |
|
|
55 | (1) |
|
|
55 | (1) |
|
Specificity of relationship types |
|
|
55 | (1) |
|
Choosing a relationship direction |
|
|
55 | (1) |
|
3.4 Tooling: Neo4j desktop |
|
|
55 | (1) |
|
3.5 Tooling: Neo4j Browser |
|
|
56 | (1) |
|
|
57 | (8) |
|
|
57 | (1) |
|
|
58 | (1) |
|
|
58 | (4) |
|
|
62 | (1) |
|
Defining database constraints with cypher |
|
|
63 | (1) |
|
|
64 | (1) |
|
|
65 | (1) |
|
3.7 Using the Neo4j client drivers |
|
|
65 | (1) |
|
|
66 | (1) |
|
4 The Neo4j GraphQL Library |
|
|
67 | (32) |
|
4.1 Common GraphQL problems |
|
|
68 | (1) |
|
Poor performance and then + 1 query problem |
|
|
68 | (1) |
|
Boilerplate and developer productivity |
|
|
69 | (1) |
|
4.2 Introducing GraphQL database integrations |
|
|
69 | (1) |
|
4.3 The Neo4j GraphQL Library |
|
|
69 | (7) |
|
|
70 | (4) |
|
Generated GraphQL schema from type definitions |
|
|
74 | (2) |
|
4.4 Basic GraphQL queries |
|
|
76 | (3) |
|
4.5 Ordering and pagination |
|
|
79 | (1) |
|
|
80 | (2) |
|
|
82 | (4) |
|
|
82 | (1) |
|
|
82 | (1) |
|
Logical operators: AND, OR |
|
|
83 | (2) |
|
|
85 | (1) |
|
4.8 Working with temporal fields |
|
|
86 | (2) |
|
Using a Date type in queries |
|
|
86 | (1) |
|
Date and DateTime filters |
|
|
87 | (1) |
|
4.9 Working with spatial data |
|
|
88 | (2) |
|
The Point type in selections |
|
|
88 | (1) |
|
|
89 | (1) |
|
4.10 Adding custom logic to our GraphQL API |
|
|
90 | (6) |
|
The @cypher GraphQL schema directive |
|
|
90 | (4) |
|
Implementing custom resolvers |
|
|
94 | (2) |
|
4.11 Introspecting GraphQL schema from an existing database |
|
|
96 | (1) |
|
|
97 | (2) |
|
Part 2 Building the frontend |
|
|
99 | (38) |
|
5 Building user interfaces with React |
|
|
101 | (15) |
|
|
102 | (2) |
|
|
103 | (1) |
|
|
103 | (1) |
|
|
104 | (1) |
|
|
104 | (6) |
|
Creating a React application with Create React App |
|
|
104 | (6) |
|
5.3 State and React Hooks |
|
|
110 | (4) |
|
|
114 | (2) |
|
6 Clientrside GraphQL with React and Apollo Client |
|
|
116 | (21) |
|
|
117 | (12) |
|
Adding Apollo Client to our React Application |
|
|
117 | (3) |
|
|
120 | (4) |
|
|
124 | (1) |
|
|
125 | (2) |
|
Caching with Apollo Client |
|
|
127 | (2) |
|
|
129 | (3) |
|
|
129 | (1) |
|
|
130 | (1) |
|
|
131 | (1) |
|
6.3 Client state management with GraphQL |
|
|
132 | (4) |
|
Local-only fields and reactive variables |
|
|
132 | (4) |
|
|
136 | (1) |
|
Part 3 Full stack considerations |
|
|
137 | (100) |
|
7 Adding authorization and authentication |
|
|
139 | (33) |
|
7.1 Authorization in GraphQL: A naive approach |
|
|
140 | (3) |
|
|
143 | (4) |
|
7.3 The @auth GraphQL schema directive |
|
|
147 | (10) |
|
|
148 | (1) |
|
The isAuthenticated authorization rule |
|
|
149 | (2) |
|
The roles authorization rule |
|
|
151 | (2) |
|
The allow authorization rule |
|
|
153 | (1) |
|
The where authorization rule |
|
|
154 | (2) |
|
The bind authorization rule |
|
|
156 | (1) |
|
7.4 Auth(): JWT as a service |
|
|
157 | (14) |
|
|
157 | (4) |
|
|
161 | (10) |
|
|
171 | (1) |
|
8 Deploying our full stack GraphQL application |
|
|
172 | (40) |
|
8.1 Deploying our full stack GraphQL application |
|
|
173 | (2) |
|
Advantages of this deployment approach |
|
|
173 | (1) |
|
Disadvantages of our deployment approach |
|
|
174 | (1) |
|
Overview of our approach to full stack GraphQL |
|
|
174 | (1) |
|
8.2 Neo4j Aura database as a service |
|
|
175 | (11) |
|
Creating a Neo4j Aura cluster |
|
|
175 | (3) |
|
Connecting to a Neo4j Aura cluster |
|
|
178 | (3) |
|
Uploading data to Neo4j Aura |
|
|
181 | (2) |
|
Exploring the graph with Neo4j Bloom |
|
|
183 | (3) |
|
8.3 Deploying a React application with Netlify Build |
|
|
186 | (16) |
|
|
187 | (9) |
|
Setting environment variables for Netlify builds |
|
|
196 | (3) |
|
|
199 | (3) |
|
8.4 Serverless GraphQL with AWS Lambda and Netlify Functions |
|
|
202 | (8) |
|
Serving a GraphQL API as a Lambda function |
|
|
202 | (2) |
|
|
204 | (1) |
|
Converting our GraphQL API to a Netlify function |
|
|
205 | (2) |
|
Adding a custom domain in Netlify |
|
|
207 | (3) |
|
8.5 Our deployment approach |
|
|
210 | (1) |
|
|
211 | (1) |
|
9 Advanced GraphQL considerations |
|
|
212 | (25) |
|
9.1 GraphQL abstract types |
|
|
213 | (13) |
|
|
213 | (1) |
|
|
214 | (1) |
|
Using abstract types with the Neo4j GraphQL library |
|
|
215 | (11) |
|
9.2 Pagination with GraphQL |
|
|
226 | (5) |
|
|
226 | (1) |
|
|
227 | (4) |
|
9.3 Relationship properties |
|
|
231 | (3) |
|
Interfaces and the @relationship GraphQL schema directive |
|
|
232 | (1) |
|
Creating relationship properties |
|
|
233 | (1) |
|
9.4 Wrapping up Full Stack GraphQL |
|
|
234 | (1) |
|
|
235 | (2) |
Index |
|
237 | |