0
0
Expressframework~5 mins

REST vs GraphQL awareness in Express - Quick Revision & Key Differences

Choose your learning style9 modes available
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?
APUT
BGET
CPOST
DDELETE
What is a key feature of GraphQL compared to REST?
AMultiple endpoints for different data
BNo need for a server
COnly supports GET requests
DSingle endpoint with flexible queries
In Express, which method would you use to create a new resource in a REST API?
Aapp.put()
Bapp.get()
Capp.post()
Dapp.delete()
Which problem does GraphQL help solve compared to REST?
AToo many HTTP methods
BOver-fetching or under-fetching data
CLack of security
DNo caching support
Which of these is NOT a REST principle?
ASingle endpoint for all queries
BMultiple endpoints for resources
CStateless communication
DUse of standard HTTP methods
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.