Skip to content

All the course files for the GraphQL Crash Course on the Net Ninja YouTube channel & on Net Ninja Pro.

Notifications You must be signed in to change notification settings

adityasahusentra/graphql-crash-course

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 

Repository files navigation

graphql-crash-course

All the course files for the GraphQL Crash Course on the Net Ninja YouTube channel & on Net Ninja Pro.

What is GraphQL

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.

Drawbacks and limitations of REST

  1. 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.
  2. 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.

How GraphQL solves both the issues

  1. It only has one single endpoint, like below:

mygrahqlsite.com/graphql

and query like this:

Query { courses { id, title, thumbnail_ur1 } }

  1. 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 } } } }

About

All the course files for the GraphQL Crash Course on the Net Ninja YouTube channel & on Net Ninja Pro.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published