🪜 Introduction to GraphQL

"FAANG might have changed to MANGA, but GraphQL is still GraphQL" 😉

🧵 👇
1️⃣ What is GraphQL?

GraphQL is

→ a query language for your API (explained in 6️⃣)

→ a server-side runtime for executing queries using a type system you define for your data (explained in 7️⃣)
2️⃣ What is an API?

✪ API stands for "Application Programming Interface".

✪ You have an application. Your application has several data. Users of your application want to fetch those data. How would they be able to do that?
✪ One way is to provide them a GUI (Graphical User Interface). User can view the data and perform any action on the data using GUI.

✪ GUI has a shortcoming viz. "Extensibility". It means a user can consume the data only through that GUI. You cannot extend this functionality.
✪ The other option is to provide user the data programmatically. As a data owner, you facilitate your application's programming interface aka API.

✪ Using API, user can fetch and/or manipulate the data from any other application. So, it's "flexible" and "extensible".
3️⃣ How were we using APIs?

✪ In earlier days, API calls used to be made through web services using SOAP (Simple Object Access Protocol).

✪ Introduction of REST (REpresentational State Transfer) made the API development process faster. Consuming an API became easier.
4️⃣ REST API

✪ REST uses HTTP (no separate protocol)
✪ REST is stateless (because HTTP is stateless)
✪ REST defines the data to be consumed as a "Resource"
✪ REST uses HTTP verbs (GET, PUT, POST etc) to perform actions on the resources.
5️⃣ Shortcomings of REST

✪ Server defines the structure of a "Resource". Client has no take in it.

✪ When client wish to fetch "some" of that resource, it cannot. It has to consume it entirely.
✪ There is no way to define any relationship between resources. To fetch a related resource, you need to make another API call.
6️⃣ What is a Query Language?

To overcome these shortcomings of REST, a query language is developed.

✪ Using the query language, client decides "how much" to consume.

✪ Query Language allows to layout a schema.
✪ Using Schema, we define the resources and their relationships.

✪ Schema also defines various queries that can be made (aka end points).

✪ Client can fetch only what it requires without having to do several trips to server. Lower latency, less bandwidth. Happy Customer.
7️⃣ What is a Server-Side Runtime?

✪ The job of Server-Side runtime is to process the client query and provide only those details that's been requested for.

✪ Server-Side runtime use the schema for all validations.
8️⃣ What are different operations in GraphQL?

→ Query: To read data

→ Mutation: To write data

→ Subscription: To listen for a data

We will describe each in future threads.
9️⃣ Where can I learn more about GraphQL?

Check the 👇 link to learn GraphQL from official sources.

graphql.org/learn/
That's it for today's topic. I hope you enjoyed this introduction to GraphQL.

Reply me stating what more you wanna learn about GraphQL or anything. I will try to do the needful.

Till we see again, do take care. 👋

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Swapna Kumar Panda ✨

Swapna Kumar Panda ✨ Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @swapnakpanda

30 Oct
JavaScript Interview Questions

Series: 1️⃣
Level: Beginner
Topics:

1️⃣ Data Types
2️⃣ Boolean
3️⃣ Number
4️⃣ Logical Operators
5️⃣ Comparison Operators
6️⃣ Arithmetic Operators
1️⃣ Data Types

✪ What all data types does JavaScript provide?
✪ How to find out data type of a value? (which operator to use)
✪ What is type coercion?
✪ Any significant difference between "undefined" and "null"?
✪ What is the type of undefined?
✪ What is the type of null?
Read 13 tweets
30 Oct
🎉 🎊 Reached 2500 in this bird app 🥳

Thanks for all the 💙 and support.

👋 I am Swapna from India 🇮🇳

I create contents on 👇

🦕 DSA
🕸 JavaScript Concepts
🐍 Python Concepts
💻 Programming Tips

👇 are some awesome people you should consider to follow and support.
1️⃣ PS / DSA
@intelocode (Math/Psychology/Mentoring as well)
@Franc0Fernand0
@imdivi_jain
@sat_yam_d
@marioarrioladev
@DanielLeskosky
@akshayvarshney6

2️⃣ System Design
@manthanguptaa
@Franc0Fernand0
@BelloneDavide (.NET as well)
Read 17 tweets
28 Oct
🛢SQL and NoSQL Database

👉 What are these?
👉 Key Differences
👉 How to choose between them?

🧵 👇
1️⃣ What is a Database?

A database is an organised collection of data stored in a computer system (typically a server machine, but can be any machine) so that it can be accessed and managed easily.
✪ Initially each database had a separate way of data management. The way one database was storing and managing data may vary from another.

✪ But with time this practice got normalised. The "Relational Database" design came into picture.
Read 21 tweets
27 Oct
💡 JavaScript Interview Preparation Simplified

If you are a beginner or, a new learner and going to appear (or already appearing) for an interview, this 🧵 is for you.

I am getting many DM requests from students about preparing for JS interviews. So I thought of coming up with a series which may help who needs it.

This is going to be a series of threads and, this one is the very first in this series.
What is expected from you in an Interview?

1️⃣ Good behaviour
2️⃣ Knowledge of Syntax
3️⃣ Knowledge of Key Features and where to apply
4️⃣ Integration with other technologies in the stack
5️⃣ Usage of a framework
6️⃣ Analytical Ability

In this thread, we will cover 2️⃣ & 3️⃣
Read 16 tweets
27 Oct
JavaScript CookBook: 7️⃣ Recipes for this Week

Recipes

1️⃣ Complex String Formation
2️⃣ String Conversions
3️⃣ Default Value Assign
4️⃣ Default Function Parameters
5️⃣ Checking properties of a possibly Nullish Object
6️⃣ Fetching Values from an Object
7️⃣ Function Argument List
Recipe 1️⃣

✪ What to Cook?
Complex String Formation

✪ Ingredient
`` (String Template Literal)

✪ Cooking Process
You were cooking like this (tedious):

→ 'Hello ' + fName + ' ' + lName

Instead cook like this:

→`Hello ${fName} ${lName}'
Read 10 tweets
26 Oct
🔥 Resources to learn Data Structures and Algorithms

1️⃣ Twitter Threads

I post almost regular threads on DSA. Check out those 👇
twitter.com/i/events/14502…
2️⃣ Blogs/Articles

1️⃣ Swapna's blog is coming soon. It will include from simple to complex topics on DSA. It will also help you getting through how to approach for solving the problem. It should be your one-stop to get familiar with DSA.

Some more to look for 👇
Read 9 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!

Follow Us on Twitter!

:(