O'Reilly logo
live online training icon Live Online training

Rethinking REST: A hands-on guide to GraphQL and queryable APIs

Arianne Dee

With the advancement of web technologies and user expectations, many current web developers are struggling with some of REST's limitations. They are being asked to build performant, intelligent, reactive, mobile-friendly applications, while trying to adhere to RESTful best-practices, and spending valuable developer time debating rather than building.

For example:

  • When your mobile experience needs to be lightning fast, but your existing API endpoints provide way more data than needed, do you over-fetch or do you create 'simple' endpoints for those resources? And what fields should they have?
  • When building overviews or dashboards, do you design custom endpoints that return a number of resource types, or do you progressively load the page while your app makes a series of API calls for each resource type?

In this training session, you will learn about GraphQL, the API query language that Facebook has been using since 2012, and how it solves each of the issues above. You will become familiar with the GraphQL language and its various features like mutations, filters, pagination, and introspection, as well as a hands on experience creating a GraphQL server. We will cover simple server implementations, with examples in Node (JavaScript) and Django (Python), which will help you get started for implementing one in any of the supported server languages: http://graphql.org/code/

Join this live training with Arianne Dee, a professional developer and educator, who has created GraphQL APIs for Django and Node.js and has years of experience teaching science and programming to adults, teens, and children. There will be plenty of time to address your questions and concerns with this new technology, and whether or not it is the right tool for you.

What you'll learn-and how you can apply it

By the end of this live online course, you’ll understand:

  • What GraphQL is and when you would want to use it
  • How it compares to REST for public and private APIs
  • Broad knowledge of the GraphQL language and its more advanced features

And you'll be able to:

  • Articulate what GraphQL is good for and what challenges are involved in creating a production-ready GraphQL server
  • Query a GraphQL API, such as GitHub's v4 API
  • Build a simple GraphQL server, with an example project in Node (JavaScript) or Django (Python)

This training course is for you because...

  • You're a front-end applications developer that wants to learn how to consume GraphQL APIs and use its rich set of features
  • You're a back-end developer and you want to learn how building GraphQL APIs can help your team and your product
  • You're a product manager, and your developers are saying that what you want can't be done due to API constraints
  • You're curious about GraphQL, want questions answered and knowledge of how to use it

Prerequisites

  • Experience consuming and/or creating RESTful APIs
  • Knowledge of Javascript and some ES6 syntax or Python
  • If you are hoping to develop a GraphQL server in a specific language, make sure that it has a supported library here: http://graphql.org/code/

Course Set-up:

  • Create a GitHub account
  • Download Node 8.9.4 or later - or - Python 3.6 and Django 2.0
  • Open this link: https://github.com/ariannedee/rethinking-rest, clone the repo, and follow the Readme instructions for either the Node server or Django server.
  • Modern browser that is not Internet Explorer (Chrome 55, Edge, Firefox 52, Opera 42, Safari 10.1)

Recommended Preparation:

About your instructor

  • Arianne is a software developer and educator from the University of British Columbia. She loves Python for its versatility and community, and GraphQL because it makes APIs fun and intuitive. She is an instructor for Canada Learning Code and a maker-in-residence at MakerLabs in Vancouver, BC. While working at 7Geese, she had a year of using GraphQL in production, during which she has done training and spoken at meet ups and conferences about the topic.

Schedule

The timeframes are only estimates and may vary according to how the class is progressing

Introduction to GraphQL (45 mins)

  • Talk about benefits and limitations of REST, and why GraphQL was created
  • Introduction to the GraphQL spec and introduction to various features
  • Participants will be introduced to GitHub's GraphiQL Explorer: https://developer.github.com/v4/explorer/
  • Ideally, participants will have their own GitHub account to explore
  • Talk about GraphQL benefits and limitations

Activity:

  • What tasks have been difficult to solve using REST?
  • How might my team benefit from using GraphQL?

Break + Q&A (15 min)

Consuming GraphQL APIs (45 min)

  • Look at different language features

Break + Q&A + discussion (15 min)

Building a GraphQL server (1 hr 45 mins)

  • Instructor will guide participants in implementing their own GraphQL server, with instructions for Node.js and Django for each step

Final discussion + Q&A (15 mins)