I have two tables: Posts and Users
In the createPost
mutation resolver, I set some default values do certain properties (think userId, createdAt timestamp, isDeleted flag etc). In addition, I would like to increment the User's numPosts
counter.
Is this possible via the standard resolvers?
If not, what's the better alternative and why?
Alternative 1) Use DynamoDB Stream and trigger lambda function when new Post record is added that increments User's numPosts
counter.
Alternative 2) Use a lambda resolver and move all logic there instead of the standard resolver.