To solve the n + 1 problem that graphql has when querying nested data or a collection, Dataloader was introduced.
https://github.com/graphql/dataloader
From AWS docs:
GraphQL Proxy
A component that runs the GraphQL engine for processing requests and mapping them to logical functions for data operations or triggers. The data resolution process performs a batching process (called the Data Loader) to your data sources. This component also manages conflict detection and resolution strategies.
https://docs.aws.amazon.com/appsync/latest/devguide/system-overview-and-architecture.html
How do I implement a Dataloader with Appsync when using Serverless Aurora as a datasource? Is this possible with just using apache velocity templates without using a lambda?
It seems that you can use a BatchInvoke
on lambda. But that has a hard limit of 5 items in each batch.
The hard limit no longer exists! You can set it from 0 to 2000.