Implementing GraphQL queries

With the boilerplate out of the way, it's time to focus on our actual GraphQL implementation. Many software layers that powered the REST API will also power the GraphQL API, specifically the model/validation layer and persistence/SQLAlchemy layer.

If you are new to GraphQL, know there are two types of operations, which GraphQL treats differently and which require slightly different code, at least when using Python and Graphene. Those two actions are queries and mutations, or reads and writes, respectively. In this section, we will cover queries. This code provides all of the functionality for every query interaction in our example API. Details of each part of this code will be discussed in later. The main entry ...

Get Serverless Design Patterns and Best Practices now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.