I’m about to create a new API for a project I’m working on and I’m looking to utilize GraphQL.
As this is a lower budget project I’m looking to also utilize serverless technologies (AWS Lambda).
I want to be able to implement cost analysis of queries in GraphQL (there is a library for this) and throttle requests.
I’m wondering what the best way to implement this is; I’m aware of a few options but they all seem to be a compromise:
- AppSync; I’m unable to implement cost or depth analysis of my queries, which could be important on this project due to not wanting to get loaded with unexpected execution costs.
- One Lambda endpoint for GraphQL and all it’s resolvers; I can’t make use of the really nice statistical analysis tools on offer by serverless if I do it this way as there is just one endpoint.
- GraphQL Lambda + Call Additional Lambda’s for Data; invoking lambda’s seems to require their names and it wouldn’t take much to “break” this by renaming something
I was wondering if anyone out there has come up with a better way of doing this; or might be aware of an architecture pattern that could suit my needs?