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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.