Thursday, July 30, 2020

GraphQL




What is GraphQL 
  • API Standard invented & open-sourced by Facebook
  • Alternative to  REST API 
  • enables declarative data fetching 
  • exposes single endpoint & responds to queries

How it works? 


Why Graphql?
  • Improvises performance by reducing the data that is to be transferred over the internet
  • Variety of different frontend frameworks and platforms on client-side
  • Fast development speed & expectation for rapid feature development




Why Graphql is better than REST?

Flexibility & efficient 





No more over /under fetching of data
Over fetching :
Under fetching:
Insightful analytics 

Schema serves as contract between client and server

CORE CONCEPTS :
SDL :SCHEMA DEFINITION LANGUAGE











Writing Data with mutations

3 kinds of mutations
  • creating new data
  • updating existing data
  • deleting existing data