Recall & Review
beginner
What is REST in web development?
REST (Representational State Transfer) is a way to design web APIs using standard HTTP methods like GET, POST, PUT, and DELETE to manage resources identified by URLs.
Click to reveal answer
beginner
What is GraphQL and how does it differ from REST?
GraphQL is a query language for APIs that lets clients ask for exactly the data they need. Unlike REST, it uses a single endpoint and flexible queries instead of multiple fixed URLs.
Click to reveal answer
beginner
Name one advantage of using REST APIs.
REST APIs are simple and use standard HTTP methods, making them easy to understand and cache for better performance.
Click to reveal answer
beginner
Name one advantage of using GraphQL APIs.
GraphQL allows clients to get exactly the data they want in one request, reducing over-fetching and under-fetching of data.
Click to reveal answer
beginner
In Express, how would you typically set up a REST API endpoint?
You use app.get(), app.post(), app.put(), or app.delete() with a URL path to handle HTTP requests for resources.
Click to reveal answer
Which HTTP method is commonly used to update a resource in REST?
✗ Incorrect
PUT is used to update or replace a resource in REST APIs.
What is a key feature of GraphQL compared to REST?
✗ Incorrect
GraphQL uses a single endpoint where clients send queries specifying exactly what data they want.
In Express, which method would you use to create a new resource in a REST API?
✗ Incorrect
POST is used to create new resources in REST APIs.
Which problem does GraphQL help solve compared to REST?
✗ Incorrect
GraphQL lets clients request exactly the data they need, avoiding over-fetching or under-fetching.
Which of these is NOT a REST principle?
✗ Incorrect
REST uses multiple endpoints for different resources, not a single endpoint.
Explain the main differences between REST and GraphQL APIs.
Think about how clients ask for data and how many URLs they use.
You got /4 concepts.
Describe how you would set up a simple REST API endpoint in Express.
Remember Express methods match HTTP verbs.
You got /4 concepts.