How it works...

This recipe builds on the Applying the database-first variant of the Event Sourcing pattern with DynamoDB recipe in Chapter 2Applying the Event Sourcing and CQRS Patterns by exposing the ability to author data in a bounded context through a GraphQL API. GraphQL is becoming increasingly popular because of the flexibility of the resulting API and the power of client libraries, such as the Apollo Client. We implement a single graphql function to support our API and then add the necessary functionality through the schema, resolvers, models, and connectors.

The GraphQL schema is where we define our types, queries, and mutations. In this recipe, we can query thing types by ID and by name, and save and delete. The resolvers map ...

Get JavaScript Cloud Native Development Cookbook 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.