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
AI コーディングエージェントの時代へ:JetBrains が描く開発の未来
masaruhr
1
200
MCPを使ってイベントソーシングのAIコーディングを効率化する / Streamlining Event Sourcing AI Coding with MCP
tomohisa
0
150
Python型ヒント完全ガイド 初心者でも分かる、現代的で実践的な使い方
mickey_kubo
1
150
技術同人誌をMCP Serverにしてみた
74th
1
680
A full stack side project webapp all in Kotlin (KotlinConf 2025)
dankim
0
130
初学者でも今すぐできる、Claude Codeの生産性を10倍上げるTips
s4yuba
16
12k
MDN Web Docs に日本語翻訳でコントリビュートしたくなる
ohmori_yusuke
1
130
イベントストーミング図からコードへの変換手順 / Procedure for Converting Event Storming Diagrams to Code
nrslib
2
930
코딩 에이전트 체크리스트: Claude Code ver.
nacyot
0
840
Rubyでやりたい駆動開発 / Ruby driven development
chobishiba
1
740
PostgreSQLのRow Level SecurityをPHPのORMで扱う Eloquent vs Doctrine #phpcon #track2
77web
2
550
PicoRuby on Rails
makicamel
2
140
Featured
See All Featured
How to Think Like a Performance Engineer
csswizardry
25
1.7k
Rebuilding a faster, lazier Slack
samanthasiow
83
9.1k
Become a Pro
speakerdeck
PRO
29
5.4k
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
Music & Morning Musume
bryan
46
6.7k
Build your cross-platform service in a week with App Engine
jlugia
231
18k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
The Straight Up "How To Draw Better" Workshop
denniskardys
235
140k
[RailsConf 2023] Rails as a piece of cake
palkan
55
5.7k
Speed Design
sergeychernyshev
32
1k
Building an army of robots
kneath
306
45k
The Invisible Side of Design
smashingmag
301
51k
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