@aws-cdk/aws-appsync-alpha: No way to enable caching for AWS AppSync and its ResolvableFields #19284
Labels
@aws-cdk/aws-appsync
Related to AWS AppSync
feature-request
A feature should be added or improved.
p2
General Issue
CDK: AWS AppSync per resolver caching
The Question
We are trying to enable per-resolver caching for some of AWS AppSync queries with cdk:
import { GraphqlApi } from '@aws-cdk/aws-appsync-alpha';
does not offer any possibility to add caching configuration. Workaround currently is to useCfnApiCache
, which is a bit unintuitive.Here a sample:
CfnResolver
and its corresponding L2 ConstructResolver
offer a resolver caching configuration, but using them doesn't work as their queries are not concatenated into the schema. Working with ResolvableFields for adding queries to my GraphQlApi works, but ResolvableFields isn't a L2 Construct, it has no caching config neither i can access its underlying cloudformation resouce.Here a sample on adding my query using ResolvableField construct:
Like described, there is no way to define a caching config for that field.
Here my attempt to define a resolver:
This resolver is not added to my graphql schema.
And finally having Resolver and ResolvableField at the same time to add operations to my GraphQlApi feels very complicated. Maybe i am missing something to define per-resolver caching behaviour with CDK, would be grateful to get any feedback soon.
Best Regards
CDK CLI Version
2.15.0
Framework Version
2.15.0
Node.js Version
v16.13.1
OS
Windows 10
Language
Typescript
Language Version
4.5.4
Other information
No response
The text was updated successfully, but these errors were encountered: