Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Getting started with GraphQL
Search
Thiago Colares
November 24, 2017
Technology
0
340
Getting started with GraphQL
The 4th Weekly company-internal Agilize DevTalk of November, 2017.
Thiago Colares
November 24, 2017
Tweet
Share
More Decks by Thiago Colares
See All by Thiago Colares
Functional programming: basic concepts you can start using today
thicolares
0
28
O básico que ainda deveríamos entender sobre Unicode e encondings
thicolares
0
380
The pragmatic agilist
thicolares
0
380
The Pragmatic Agilist
thicolares
0
40
Domain-Driven Design com PHP
thicolares
0
430
Other Decks in Technology
See All in Technology
QA業務を変える(!?)AIを併用した不具合分析の実践
ma2ri
0
140
Introdução a Service Mesh usando o Istio
aeciopires
1
290
Wasmの気になる最新情報
askua
0
190
組織全員で向き合うAI Readyなデータ利活用
gappy50
0
210
AI-Readyを目指した非構造化データのメダリオンアーキテクチャ
r_miura
1
320
AIエージェント入門 〜基礎からMCP・A2Aまで〜
shukob
1
180
AI時代におけるデータの重要性 ~データマネジメントの第一歩~
ryoichi_ota
0
710
IoTLT@ストラタシスジャパン_20251021
norioikedo
0
140
SRE × マネジメントレイヤーが挑戦した組織・会社のオブザーバビリティ改革 ― ビジネス価値と信頼性を両立するリアルな挑戦
coconala_engineer
0
220
「最速」で Gemini CLI を使いこなそう! 〜Cloud Shell/Cloud Run の活用〜 / The Fastest Way to Master the Gemini CLI — with Cloud Shell and Cloud Run
aoto
PRO
1
180
AI機能プロジェクト炎上の 3つのしくじりと学び
nakawai
0
110
From Natural Language to K8s Operations: The MCP Architecture and Practice of kubectl-ai
appleboy
0
210
Featured
See All Featured
Gamification - CAS2011
davidbonilla
81
5.5k
We Have a Design System, Now What?
morganepeng
53
7.8k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Intergalactic Javascript Robots from Outer Space
tanoku
272
27k
Product Roadmaps are Hard
iamctodd
PRO
55
11k
Speed Design
sergeychernyshev
32
1.2k
Raft: Consensus for Rubyists
vanstee
140
7.2k
Large-scale JavaScript Application Architecture
addyosmani
514
110k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
9.7k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
3.7k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
253
22k
Automating Front-end Workflow
addyosmani
1371
200k
Transcript
GETTING STARTED WITH GraphQL Agilize Cloud Accounting, 24/11/2017 Weekly company-internal
DevTalks
Hallo! I’M THIAGO COLARES Agile manager Full stack developer Open
source Co-founder @ Agilize Cloud Accounting @thicolares
1. DEFINE: GraphQL
WHAT IS GRAPHQL ◦ Declarative data fetching ◦ Alternative to
REST ◦ Single endpoint → responds to queries
/authors/<id> /authors/<id>/books /authors/<id>/followers 3 ENDPOINTS
query query query 1 SINGLE ENDPOINT
DEMO 1
2. CHARACTERISTICS
GraphQL TIMELINE ◦ Developed by Facebook on 2012 ◦ Presented
→ React.js Conf 2015 ◦ Is not for React Developers ◦ Other companies had the same initiative ◦ Netflix → Falcor ◦ Cousera → Now uses GraphQL
REST CHALLENGES ◦ Need for efficient data loading (mobile) ◦
Variety of different frontend frameworks ◦ Rapid feature development
GraphQL BENEFITS ◦ No mover over or underfetching ◦ Almost
non API if the interface changes ◦ Faster feedbacks cycles
INSIGHTFUL ANALYTICS ◦ Fine-grained info about what read data ◦
Evolving and deprecating API
3. KEY CONCEPTS
type Query { ... } type Mutation { ... }
type Subscription { ... } ROOT TYPE
query { User(id: 123) { name posts { title }
} } QUERY HTTP POST
{ "data": { "User": { "name": "Joston Muriel", "posts": [
{title: "Hello, it's me"} {title: "Lines in the sand"} ] } } } RESPONSE RESPONSE
SCHEMA ◦ Strong type system ◦ Schema as client-server contract
◦ Client and server can work independently ◦ Schema Definition Language
type Person { name: String! age: Int! } DEFINING SIMPLE
TYPES ! → required
type Person { name: String! age: Int! } ADDING A
RELATION type Post { title: String! author: Person! }
type Person { name: String! age: Int! posts: [Post!]! }
ADDING A HAS-MANY RELATION type Post { title: String! author: Person! }
DEMO 2
4. MUTATIONS
WRITING DATA WITH MUTATIONS ◦ A query too ◦ You
can ask for the returning fields ◦ Even nested ones
3 KINDS OF MUTATIONS ◦ creating new data ◦ updating
existing data ◦ deleting existing data
A MUTATION mutation { createPerson(name: "Bob", age: 36) { name
age } } Similar syntax. Mutation keyword. Special root field.
DEFINING A MUTATION type Mutation { createPerson(name: String!, age: String!)
Person! ... }
5. NODE EXAMPLE
DEMO 3
“ Nescit cedere
THANKS! Thiago Colares @thicolares