Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Building a GraphQL API with DJango

Building a GraphQL API with DJango

Slides from the Tutorial at DjangoCon 2017

James Muranga

August 13, 2017
Tweet

Other Decks in Programming

Transcript

  1. SETUP •Python •An Editor (VSCode, Atom, PyCharm etc) •Starter project

    http://bit.ly/2fCLUGp FEEL FREE TO INTERRUPT AND ASK QUESTIONS
  2. RESTFUL API FOR “SOME APP” •List of Users •Each User

    has notes •Each Notes has revisions
  3. 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 } ] }
  4. 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",
  5. Polls App • Setup • Walkthrough the App • Add

    Schema • Browse GraphiQL • Write Tests • Add mutation • Write more tests • Handle Users • Questions
  6. SETUP •Python •An Editor (VSCode, Atom, PyCharm etc) •Starter project

    http://bit.ly/2fCLUGp FEEL FREE TO INTERRUPT AND ASK QUESTIONS