About This Tutorial
WHAT is the workshop about?
In this workshop you’ll learn what GraphQL is and why it is a viable alternative to REST for building powerful APIs. You’ll also build your very own GraphQL API from scratch based on Django and the popular graphene-python library. No previous experience with GraphQL is required.
WHY should you attend?
GraphQL is much more than a library or technical specification. One of its most valuable assets is the mindset that encourages robust, scalable, and elegant design patterns for building APIs. It can help you better understand and express the individual parts of your application (nodes), and how they interact with each other (edges). It will also provide structure to both how you build and consume your API, documenting itself along the way, reducing friction and boosting productivity in the frontend and backend implementations.
We’ll start with a quick intro to get acquainted with GraphQL and some basic concepts. Then we’ll jump right into our text editors and explore a Django app with an existing set of models. We’ll write the required code to expose our models via a GraphQL API that will allow us to query and modify the records in the database. We will use GraphiQL, an in-browser IDE, to explore our API (we won’t write any frontend code).
- Shallow dive into graph theory
- GraphQL: the spec
- GraphQL vs REST
- Graphene and Django
- Installing Graphene
- Write your first resolver
- Exploring your API with GraphiQL
- Queries: exposing our data via GraphQL
- Django models as nodes
- Single node queries
- Edge queries via connection fields
- Queries and filters
- Mutations: modifying our data via GraphQL
- Node creation
- Node updates
- Review and learning resources
You should have Python and Django installed in your computer, and be comfortable installing packages via pip. You should be familiar with Python classes (attributes, methods, and inheritance) and with Django’s ORM (models and querysets). Experience with REST APIs is a plus, but not necessary to understand the content.