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
Building a GraphQL API with DJango
Search
James Muranga
August 13, 2017
Programming
1
110
Building a GraphQL API with DJango
Slides from the Tutorial at DjangoCon 2017
James Muranga
August 13, 2017
Tweet
Share
Other Decks in Programming
See All in Programming
Vibe Coding - AI 驅動的軟體開發
mickyp100
0
180
インターン生でもAuth0で認証基盤刷新が出来るのか
taku271
0
190
AtCoder Conference 2025
shindannin
0
1.1k
コントリビューターによるDenoのすゝめ / Deno Recommendations by a Contributor
petamoriken
0
200
CSC307 Lecture 10
javiergs
PRO
1
660
KIKI_MBSD Cybersecurity Challenges 2025
ikema
0
1.3k
AIによる開発の民主化を支える コンテキスト管理のこれまでとこれから
mulyu
3
370
プロダクトオーナーから見たSOC2 _SOC2ゆるミートアップ#2
kekekenta
0
220
20260127_試行錯誤の結晶を1冊に。著者が解説 先輩データサイエンティストからの指南書 / author's_commentary_ds_instructions_guide
nash_efp
1
980
疑似コードによるプロンプト記述、どのくらい正確に実行される?
kokuyouwind
0
390
AI巻き込み型コードレビューのススメ
nealle
2
400
フロントエンド開発の勘所 -複数事業を経験して見えた判断軸の違い-
heimusu
7
2.8k
Featured
See All Featured
The Power of CSS Pseudo Elements
geoffreycrofte
80
6.2k
RailsConf 2023
tenderlove
30
1.3k
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
100
It's Worth the Effort
3n
188
29k
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
0
180
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.6k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.8k
The browser strikes back
jonoalderson
0
390
Statistics for Hackers
jakevdp
799
230k
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
0
440
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
67
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
130
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