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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Thiago Colares
November 24, 2017
Technology
400
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Getting started with GraphQL
The 4th Weekly company-internal Agilize DevTalk of November, 2017.
Thiago Colares
November 24, 2017
More Decks by Thiago Colares
See All by Thiago Colares
How pgvector extends PostgreSQL
thicolares
0
23
Functional programming: basic concepts you can start using today
thicolares
0
58
O básico que ainda deveríamos entender sobre Unicode e encondings
thicolares
0
440
The pragmatic agilist
thicolares
0
440
The Pragmatic Agilist
thicolares
0
40
Domain-Driven Design com PHP
thicolares
0
470
Other Decks in Technology
See All in Technology
【AG-UI × A2UI × MCP Apps】Generative UIをやさしく解説する
nrinetcom
PRO
1
140
【CEDEC2026】コードレビュー支援ツール開発から学ぶ:LLMを用いた業務システムの実践的な運用設計と誤出力対策
cygames
PRO
0
840
カートの信頼性を担保するWireMockを使ったe2eテスト
ykagano
0
370
QAエンジニア起点で進める、SmartHRにおける信頼性向上について
kaomi_wombat
1
150
モノリス Rails でも日中に rails db:migrate を走らせたい! / Daytime rails db:migrate on Monolithic Rails!
euglena1215
4
630
LLM・AIエージェントシステムベストプラクティス
shibuiwilliam
6
1.4k
侵入は突然に 〜 IoTマルウェアと悪用される家庭の機器 ~ / When Intrusion Strikes: IoT Malware and the Abuse of Home Devices
nttcom
0
5.9k
MulticaとPi Coding Agentで、小規模OSSを30本同時運用した流れ
eiei114
0
130
モダンフロントエンド 開発研修
recruitengineers
PRO
4
730
Kiro Crew入門 - 常駐エージェントの仕組みと使いどころ / Intro to Kiro Crew
k_adachi_01
1
300
つくって納得、つかって実感! 大規模言語モデルことはじめ ver2.0
recruitengineers
PRO
5
1.8k
SmartHR Engineering Team Deck
smarthr
1
2.3k
Featured
See All Featured
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
30k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
56
3.4k
Raft: Consensus for Rubyists
vanstee
141
7.6k
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
710
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
790
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
1
2.8k
How to build a perfect <img>
jonoalderson
1
5.9k
ラッコキーワード サービス紹介資料
rakko
1
4.4M
SEO for Brand Visibility & Recognition
aleyda
0
4.7k
Writing Fast Ruby
sferik
630
63k
30 Presentation Tips
portentint
PRO
1
370
BBQ
matthewcrist
89
10k
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