$ cd ..
$ graphql --pick-your-fields▮
REST returns whole objects; GraphQL returns exactly the fields you tick. Watch the payload shrink.
# steps
- 1Sign in & ensure sample data.
- 2Tick / untick fields below.
- 3Compare: REST sends everything, GraphQL sends only your selection.
// pick task fields
// live query
graphqlquery BoardTasks($id: UUID!) {
board(id: $id) {
tasks {
id
title
status
}
}
}POST /graphql · operationName: BoardTasks · 1 request, any depth, versus REST's 1 + N round-trips for nested data.
// the wire
1
Pick fields
2
Query shaped
3
1 request
4
Resolve
5
Your fields
- B
REST · FULL OBJECTS
vs
- B
GRAPHQL · YOUR FIELDS
-
smaller
// run both to compare the payload sizes
No board yet - sign in & click “Create sample data” on Home, then run both.
GET
// run both to see the full objects payload
POST/graphql
// run both to see only your selected fields