GraphQL Course
Ask for exactly the fields you need - and watch the response change as you do it.
Take this course in the learning hubLessons
- Over-fetching and under-fetchingThe two REST problems GraphQL was built to solve - see them both in one query.
- The schema is the contractA typed schema is what makes tooling, validation and safe evolution possible.
- Arguments, aliases and variablesParameterise a query properly, and fetch the same field twice in one request.
- Resolvers and the N+1 problemGraphQL makes N+1 easier to cause than REST did - and DataLoader is the standard fix.
- MutationsWrites have their own root type, run in series, and should return what changed.
- SubscriptionsThe third operation type: the server pushes to you, over a connection that stays open.
- Query cost and abuseLetting clients shape queries means letting them shape expensive ones.
- Errors and null propagationGraphQL returns 200 with an errors array - and a non-null failure can wipe out its parent.
- GraphQL or REST?An honest comparison - GraphQL is a trade, not an upgrade.
- Variables, fragments and operation namesHow real clients send queries, rather than string concatenation.
- DataLoader: the real fix for N+1Resolvers are called per object - batching is what makes that survivable.
- Pagination the Relay wayCursors over offsets, and why the connection shape looks odd.
- GraphQL in Spring BootSchema-first wiring, controllers and testing.
- Depth, complexity and hostile queriesA public GraphQL endpoint lets a client write its own denial of service.