Learn GraphQL in 4 Hours
Published by Pearson
A hands-on guide to GraphQL and queryable APIs
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 live event is for you because...
- Create a GitHub account
- Download Node 8.9.4 or later - or - Python 3.6 and Django 2.0
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 follow-up:
- Watch Rethinking REST: A hands-on guide to GraphQL and Queryable APIs (Video by Arianne Dee)
Schedule
The time frames 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)
- Use GitHub's GraphQL API to perform queries and mutations on real, production data
- Discuss types, errors, pagination and versioning
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)
Your Instructor
Arianne Dee
Arianne is a full-stack software developer and freelancer, with a passion for user-focused design for the public good. She has bachelor’s degrees in Civil Engineering and Computer Science from the University of British Columbia, and has taught thousands of students, aged 9 – 99 through Engineers Without Borders, Canada Learning Code, and Pearson on the O’Reilly platform. Arianne’s most popular videos and live trainings help beginners and experienced developers get up to speed with Python