Closed elieux closed 1 year ago
this issue should be resolved now with latest version of APPSYNC_JS and utils package
Seems to be consistent now, thanks.
Hi @elieux and or @onlybakam
I hope you don't mind answering a question for me.
The way AWS seem to promote unit testing JS AppSync resolvers is to AppSync.evaluateCode
from the AWS SDK which will as far as I can tell actually execute the resolver somewhere in AWS.
However, it seemed to me that it should be possible to test by running the resolver code locally rather than in AWS. (In fact, I assume thats WHY there is a published @aws-appsync/utils npm package)
reading between the lines of this issue, it seems like @elieux is indeed testing by running resolver code locally?
Can anyone confirm if this is a workable approach? Is it a good idea or is it best to stick to the evaluateCode
approach?
Thanks
It seems that recently (sometime this month I guess) AppSync started using updated type definitions in the package @aws-appsync/utils internally and the package published on NPM is left out of date. The type that started breaking our builds is Context, which is now generic (with stricter defaults than the previous non-generic type).
Our code that is now being rejected by AppSync looks like this:
Specifying the type parameters makes it work again.
In order to make both local/CI and AppSync internal checks pass, we're doing a code transformation before deploying, but that's obviously not ideal. We're using version 1.1.0 of the package; https://www.npmjs.com/package/@aws-appsync/utils/v/1.1.0