COMP9321 · 07 GraphQL · Lists & facts

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/5

encourage image

There's no tags or description

Looks like no tags are added yet.

6 Terms

1
New cards
REST vs GraphQL: endpoints, response shape, typing.
REST: many endpoints, shape fixed by the server, weak typing. GraphQL: one endpoint, shape chosen by the client, strongly typed schema.
2
New cards
REST vs GraphQL: best for, and downsides.
REST: simple well-defined resources, easy HTTP caching / over- and under-fetching, versioning. GraphQL: large interrelated data / complexity, expensive nested queries (depth limits), harder caching, error handling.
3
New cards
Why is HTTP caching harder with GraphQL?
Everything goes through one POST endpoint, so URL-based GET caching doesn't apply.
4
New cards
GraphQL's three operations and REST analogues.
Query = GET. Mutation = POST/PUT/PATCH/DELETE. Subscription = real-time push (REST: polling).
5
New cards
One-line answer: when GraphQL, when REST?
GraphQL when clients need flexible, nested views of interconnected data (mobile app, slow network); REST for simple resources where HTTP caching and simplicity matter.
6
New cards
Write a GraphQL query for user 1's name and last 2 orders (id, total).
query { user(id: 1) { name orders(last: 2) { id total } } } — one request to POST /graphql.