All the course files for the GraphQL Crash Course on the Net Ninja YouTube channel & on Net Ninja Pro.
GraphQL is a query language for your API, and a server-side runtime for executing queries using a type system you define for your data.
- Over fetching - fetching more data than required, like when there a author linked with a course than needs to be fetched with another API call.
- Under fetching - fetching less data than needed, like if I need only id and name from a resource, but the GET returns all the fields.
- It only has one single endpoint, like below:
mygrahqlsite.com/graphql
and query like this:
Query { courses { id, title, thumbnail_ur1 } }
- It allows to fetch nested related data within a query:
Query { course(id: "1") { i du, title, thumbnail_url, author { name, id, courses { id, title, thumbnail_url } } } }