InterviewBuddy
All interview questions

How do REST and GraphQL differ in selecting response data?

Beginner

Answer

REST commonly exposes resource endpoints with server-defined responses. GraphQL lets clients select fields from a typed schema.

Explanation

Neither approach automatically guarantees fewer database calls or better performance.

Example

GET /users/42 versus a GraphQL user field selecting id and name