admin管理员组文章数量:1287285
I'm working on a CDK project using TS. I'm relatively new to TS development. I wonder what's the best way to share my generated types from the GraphQL schema so that I can access them from my Lambdas.
I tried tsconfig.pahts
, but it's pretty cumbersome.
I've read about Lambda layers, but seem to be problematic as well.
My current approach is to deploy everything to the Lambda (which isn't ideal either, but at least is easy to understand):
// Lambda: ProductList
this.productListLambda = new lambda.Function(this, "ProductListLambda", {
runtime: lambda.Runtime.NODEJS_LATEST,
handler: "lib/lambda/productList/productList.handler",
code: lambda.Code.fromAsset(path.join(__dirname, "../dist")),
environment: {
PRODUCT_LIST_TABLE: props.productListTable.tableName,
},
});
My types are located at /lib/graphql/generated
本文标签: typescriptCDK and TS Share types between GraphQL and LambdaStack Overflow
版权声明:本文标题:typescript - CDK and TS: Share types between GraphQL and Lambda - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741288492a2370411.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论