Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(parser): Add appsync resolver event Zod schemas #3301

Merged
merged 4 commits into from
Nov 22, 2024

Conversation

svozza
Copy link
Contributor

@svozza svozza commented Nov 8, 2024

Summary

This PR adds Zod schemas for AppSync lambda resolvers and AppSync lambda batch resolvers.

Changes

  • Adds the Zod schema for the two event types
  • Exports the TS types derived from the schema
  • Adds tests, both positive and negative
  • Adds example payloads as a doc string and links to the relevant AWS docs

Issue number:
Resolves #3283.


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.

@svozza svozza requested review from a team as code owners November 8, 2024 14:47
@boring-cyborg boring-cyborg bot added dependencies Changes that touch dependencies, e.g. Dependabot, etc. parser This item relates to the Parser Utility tests PRs that add or change tests labels Nov 8, 2024
Copy link

boring-cyborg bot commented Nov 8, 2024

Thanks a lot for your first contribution! Please check out our contributing guidelines and don't hesitate to ask whatever you need.
In the meantime, check out the #typescript channel on our Powertools for AWS Lambda Discord: Invite link

@pull-request-size pull-request-size bot added the size/XL PRs between 500-999 LOC, often PRs that grown with feedback label Nov 8, 2024
@svozza svozza force-pushed the appsync-zod-schemas branch 2 times, most recently from 9527023 to bc745e4 Compare November 8, 2024 15:10
@svozza svozza changed the title feat (parser): Add appsync resolver event Zod scemas feat(parser): Add appsync resolver event Zod scemas Nov 8, 2024
@svozza svozza changed the title feat(parser): Add appsync resolver event Zod scemas feat(parser): Add appsync resolver event Zod schemas Nov 8, 2024
@svozza svozza force-pushed the appsync-zod-schemas branch from bc745e4 to b01ead8 Compare November 8, 2024 16:26
Copy link
Contributor

@dreamorosi dreamorosi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much for opening this PR @svozza!

I have done a first quick review and it's looking good, only left a couple minor comments.

On Monday I will do a more comprehensive review with a test build of the utility and get back to you.

packages/parser/package.json Outdated Show resolved Hide resolved
packages/parser/src/schemas/appsync.ts Outdated Show resolved Hide resolved
@svozza svozza force-pushed the appsync-zod-schemas branch from 2f9c332 to 78faf37 Compare November 8, 2024 17:47
Copy link
Contributor

@leandrodamascena leandrodamascena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not looking at the TS part because you guys are more expert than me in that area, but looking at the events it looks pretty good to me. I just made an observation because AppSync sends domainName when invoking with a custom domain name and when not invoking it is None.

Nice work and attention to detail @svozza! 👏

packages/parser/src/schemas/appsync.ts Outdated Show resolved Hide resolved
packages/parser/src/schemas/appsync.ts Show resolved Hide resolved
@pull-request-size pull-request-size bot added size/XXL PRs with 1K+ LOC, largely documentation related and removed size/XL PRs between 500-999 LOC, often PRs that grown with feedback labels Nov 9, 2024
@svozza svozza force-pushed the appsync-zod-schemas branch from 36abe5c to d9cabcc Compare November 10, 2024 09:29
@svozza svozza force-pushed the appsync-zod-schemas branch from d9cabcc to 23fd85c Compare November 12, 2024 10:40
@svozza svozza force-pushed the appsync-zod-schemas branch from 23fd85c to 3db41a1 Compare November 19, 2024 20:51
@dreamorosi dreamorosi self-requested a review November 22, 2024 14:56
Copy link
Contributor

@dreamorosi dreamorosi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR @svozza - appreciate it!

@dreamorosi dreamorosi merged commit 318f34b into aws-powertools:main Nov 22, 2024
37 checks passed
Copy link

boring-cyborg bot commented Nov 22, 2024

Awesome work, congrats on your first merged pull request and thank you for helping improve everyone's experience!

Copy link
Contributor

@aws-powertools/lambda-typescript No related issues found. Please ensure 'pending-release' label is applied before releasing.

@github-actions github-actions bot added the feature PRs that introduce new features or minor changes label Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Changes that touch dependencies, e.g. Dependabot, etc. feature PRs that introduce new features or minor changes parser This item relates to the Parser Utility size/XXL PRs with 1K+ LOC, largely documentation related tests PRs that add or change tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request: Add AppSync Resolver Event Schema to Parser
3 participants