Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Graphql workshop
Search
Aashima Ahuja
September 18, 2024
9
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Graphql workshop
GraphQL workshop React Alicante
Aashima Ahuja
September 18, 2024
Featured
See All Featured
[RailsConf 2023] Rails as a piece of cake
palkan
59
7.1k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
The Cost Of JavaScript in 2023
addyosmani
55
10k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.6k
The Curious Case for Waylosing
cassininazir
1
570
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
2
730
The Language of Interfaces
destraynor
162
27k
Writing Fast Ruby
sferik
630
63k
We Have a Design System, Now What?
morganepeng
55
8.4k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
630
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
450
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
260
Transcript
For React Developers @aashimaahuja22
None
Agenda 1. Introduction 2. Graphql fundamentals 3. Graphql Server 4.
GraphQl Client (Apollo Client) 5. Graphql with typescript
Introduction
GraphQL introduction 1. Restful Routing 2. Shortcomings of Restful Routings
3. What is GraphQL ? 4. Why GraphQL ?
RESTful Routing They are set of rules that are used
to carry out the CRUD operations, by using a set of HTTP verbs to make server requests.
Enter some content Post Enter some content Delete Edit http://
http://
HTTP methods URL Method Operation /posts POST Create a new
post /posts GET Fetch all posts /posts/23 GET Fetch post 23 /posts/20 PUT update post 20 /posts/12 DELETE delete post 12
Restful conventions URL Method Operation /<name> POST Create a record
/<name> GET Fetch all records /<name>/:id GET Fetch record with given id /<name>/:id PUT update record with given id /<name>/:id DELETE delete record with given id
Nested Urls URL Method Operation /users/2/posts POST Create a new
post /users/2/posts GET Fetch all posts users/2/posts/23 GET Fetch post 23 users/2/posts/20 PUT update post 20 users/2/posts/12 DELETE delete post 12
Shortcomings of RESTful routing John Doe software engineer at Google
Sarah Drasner software engineer at Netlify David Miller software engineer at X Cool Dude Fashion Designer @Tommy username company
Tables userId ID name String company_id ID position_id ID id
ID name String description String User Company id ID name String description String Position
User Friend Friend Friend Company Position Company Position Company Position
/user/23 /user/23/friends ???
Friend Friend Friend Company Position Company Position Company Position /user/23/friends
/users/1/company /users/1/position /users/2/company /users/2/position
Friend Friend Friend Company Position Company Position Company Position /user/23/friends_with_companies_and_positions
{ id: 12, name: ‘Apple’, stockPrice: ‘’, type: ‘public’ }
RESTful Routing shortcomings 1. Difficult to define urls in case
of heavily nested relations 2. Too many http calls 3. Over Fetching data
User User User User Company Position Company Position Company Position
query { user(id: “23”) { friends { company name }
} } User User User User Company Position Position Company Position
Writing first graphql query
Graphql Academy Project
Graphql academy - Display list of courses - Show details
of each course - Add new course - Delete a course - Update details of a course
Client Server GraphQL
Client Server GraphQL Database
Client Server GraphQL Database data access
Client Server GraphQL Database data access Auth
Client Server GraphQL Database data access Auth Web framework
Client Server GraphQL Database data access Auth Next JS
Client Server GraphQL SQLite data access Auth Next JS
Client Server GraphQL SQLite knex Auth Next JS
Client Server Apollo Server SQLite knex Auth Next JS
Client Server Apollo Server SQLite knex Next JS
Thankyou Slides Github repo link