In order to prevent breaking changes, my solution was to branch off of the existing code if the cacheKeyParameter includes a value property, which indicates the cache key is from a mapped HTTP header. This new functionality also opens up the possibility of using other values like context.VARIABLE_NAME in mapping expressions as well.
I have updated the README and added additional tests to document this new functionality.
With the following configuration, I was able to achieve my desired configuration for a sample /graphql endpoint:
HI @DianaIonita!
Similar to PR https://github.com/DianaIonita/serverless-api-gateway-caching/pull/65, I needed a way to configure API Gateway to cache responses from my GraphQL Lambda function using
method.request.body
as a cache key.In order to prevent breaking changes, my solution was to branch off of the existing code if the
cacheKeyParameter
includes avalue
property, which indicates the cache key is from a mapped HTTP header. This new functionality also opens up the possibility of using other values likecontext.VARIABLE_NAME
in mapping expressions as well.I have updated the README and added additional tests to document this new functionality.
With the following configuration, I was able to achieve my desired configuration for a sample
/graphql
endpoint:GET
POST