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
Building a GraphQL API with DJango
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
James Muranga
August 13, 2017
Programming
130
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Building a GraphQL API with DJango
Slides from the Tutorial at DjangoCon 2017
James Muranga
August 13, 2017
Other Decks in Programming
See All in Programming
Rでドレミ/Do-Re-Mi_with_R
florets1
0
130
カツオ、ご期待ください
suneo3476
0
170
re:Inventに行く前に知っておきたい現地参加のノウハウ
nokomoro3
0
400
UnityでSystem.Net.WebSocketsなWebSocketサーバが動かないのでUnity Monoのコードを覗いてみた / about implementing websocket server with unity mono
drumath2237
1
590
APNsからLive Activityを開始する話
yumnumm
0
170
R8 の設定見直しでアプリサイズ削減
andpad
0
210
JAWS-UG 東京支部が始める、JAWS-UG支部コラボ / JAWS-UG lunchtime LT Collaboration
y0hgi
0
240
速習iPhone Duo対応
yuukiw00w
2
980
Herb in Rails 8.2: Your ERB views, now HTML-aware @ Rails World 2026, Austin, Texas
marcoroth
0
210
設計次第でAIコードの読む量は減らせる / designing-for-code-reading
minodriven
34
16k
複雑なUIコンポーネントとの ⻑い付き合い⽅:波及するバグからテスト戦略を経て、安全な再設計へ
mixplace
0
390
モデルのリファクタリングが難しいと思ったら、そもそも複雑だったのはビジネス仕様だった ? / is-the-business-domain-the-real-complexity
hatsu38
0
460
Featured
See All Featured
Automating Front-end Workflow
addyosmani
1369
210k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.9k
Test your architecture with Archunit
thirion
2
2.4k
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.5k
Docker and Python
trallard
47
4.2k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
1k
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
320
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
68
58k
Believing is Seeing
oripsolob
1
240
The Invisible Side of Design
smashingmag
301
52k
Crafting Experiences
bethany
1
380
Transcript
Building A GraphQL API Using Django James Muranga
Developer at ThoughtWorks @murangajames
[email protected]
PLEASE SHARE ANY FEEDBACK YOU
HAVE FOR ME
Building A GraphQL API Using Django
AGENDA •What is GraphQL •Why? •Graphene ? •Django App
SETUP •Python •An Editor (VSCode, Atom, PyCharm etc) •Starter project
http://bit.ly/2fCLUGp FEEL FREE TO INTERRUPT AND ASK QUESTIONS
GraphQL A Query Language for APIs
Defines shape of Data Hierarchical Strongly typed Protocol Introspective
Defines shape of Data Hierarchical Strongly typed Protocol Introspective
Defines shape of Data Hierarchical Strongly typed Protocol Introspective
Defines shape of Data Hierarchical Strongly typed Protocol Introspective
Defines shape of Data Hierarchical Strongly typed Protocol Introspective
Why GraphQL ?
•REST •SOAP •JSON RPC •… What else is there ?
RESTFUL API FOR “SOME APP” •List of Users •Each User
has notes •Each Notes has revisions
GET https://api.someapp.com/api/v1/users [ { "id": "2016", "name": "The one who
cant be named", "notes": [ { "id": "2015", "content": "The friend", "revision": "1", "size": 108, "topics": [ "octocat", "atom", "electron", "API" ], "has_issues": true, "has_wiki": true, "has_pages": false, "has_downloads": true, "pushed_at": "2011-01-26T19:06:43Z", "created_at": "2011-01-26T19:01:12Z", "updated_at": "2011-01-26T19:14:43Z", "permissions": { "admin": false, "push": false, "pull": true }, "subscribers_count": 42, "network_count": 0 } ] }
REQUESTS ARE HUGE !!!
GET https://api.someapp.com/api/v2/users [ { "id": "2016", "name": "The one who
cant be named", "notes": "https://api.app.com/api/users/2016/notes" } ] GET https://api.someapp.com/api/v2/users/2016/notes [ { "id": "2015", "content": "The friend", "revision": "1", "size": 108, "topics": [ "octocat",
REQUESTS ARE MANY !!!
Request Response
Graphene an example implementation in Python
SCHEMA QUERY MUTATION
None
None
None
SCHEMA QUERY MUTATION
SCHEMA QUERY MUTATION
None
GRAPHENE DEMO http://bit.ly/2fCLUGp
Polls App • Setup • Walkthrough the App • Add
Schema • Browse GraphiQL • Write Tests • Add mutation • Write more tests • Handle Users • Questions
SETUP •Python •An Editor (VSCode, Atom, PyCharm etc) •Starter project
http://bit.ly/2fCLUGp FEEL FREE TO INTERRUPT AND ASK QUESTIONS
Debug GRAPHENE = { 'SCHEMA': 'polls.schema.schema', 'MIDDLEWARE': [ 'graphene_django.debug.DjangoDebugMiddleware', ]
} debug = graphene.Field(DjangoDebug,name='__debug')
Schema ./manage.py graphql_schema —schema out.json
Users
http://graphene-python.org/ http://graphql.org/
GraphQL is just another tool