How does GraphQL differ from traditional REST APIs in terms of data fetching?
- GraphQL typically uses POST requests for all data fetching.
- GraphQL requires a unique endpoint for each data type.
- GraphQL allows clients to request exactly the data they need.
- GraphQL is limited to retrieving data from a single source.
GraphQL differs from traditional REST APIs because it allows clients to request exactly the data they need. In REST, endpoints are predefined, and clients often receive more data than required. GraphQL uses a single endpoint and a query language that enables clients to specify the structure of the response, reducing over-fetching of data. The other options are not accurate differentiators between GraphQL and REST.
Loading...
Related Quiz
- What is the main advantage of using React's Context API?
- When using Render Props, which React concept allows the parent to access the state of the child component?
- You've been tasked with implementing state updates in a Redux application. Which principle should you adhere to ensure the predictability of state changes?
- Which React feature allows you to display a fallback UI while a component tree waits for a component to be lazily loaded?
- React abstracts away the browser's native event system with its own system called ________.