question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

@aws-cdk/aws-appsync-alpha: Issue defining resolver caching keys

See original GitHub issue

Describe the bug

I enabled PER_RESOLVER_CACHING for my appsync graphql api. I tried to defined a caching config for new Resolver, but the cachingKeys are not getting deployed.

const resolver = new Resolver(scope, `Resolver`,
  {
    ...config,
    api: this,
    cachingConfig: {
      ttl: Duration.seconds(3600),
      cachingKeys: ['$context.identity.claims.https://domain:prop'],
    },
  }
);

Expected Behavior

The resolver gets deployed as i have a valid cachingKey defined $context.identity.claims.https://domain:prop

Current Behavior

Deployment of stack crashes with Error Caching keys need to start with $context.args, $context.arguments, $context.identity, or $context.source. (Service: AWSAppSync; Status Code: 400; Error Code: BadRequestException; Request ID: 37982d8a-0e08-4a7c-b4b5-35be0a001569; Proxy: null)

Reproduction Steps

Just try to define a resolver like i did.

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.25.0

Framework Version

2.25.0

Node.js Version

v16.13.1

OS

Windows 10

Language

Typescript

Language Version

4.5.4

Other information

Same issue reported here https://github.com/aws/aws-appsync-community/issues/202

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
otaviomacedocommented, Aug 5, 2022

Yes, I’m afraid that’s a limitation on the AppSync side. I’m closing this, as there is nothing we can do on the CDK side. Feel free to reopen it if anything changes.

0reactions
github-actions[bot]commented, Aug 5, 2022

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Caching and compression - AWS AppSync
When you specify only a TTL and no caching keys, the behavior of the resolver is the same as full request caching. Cache...
Read more >
The Benefits of Implementing Pre-Resolver Caching - Aircall
It's impossible for us to cache a Resolver that requires fresh data. After selecting our ideal use case, we worked with our Product...
Read more >
Serverless Caching Strategies — Part 4 (AppSync)
How to use serverless caching strategies within your solutions, with code examples and visuals, ... You can specify a TTL and caching keys...
Read more >
Cache Database Requests Across GraphQL Resolvers
We're going to build a cache that sits between the GraphQL resolvers and the ... Use GraphQL Data Loaders to Prevent Scaling Issues...
Read more >
How I used DynamoDB as a long-term cache layer for AppSync
AppSync HTTP resolver with DynamoDB cache layer ... Then, I could have a resolver that looks into the table for a given cache...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found