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

feature(function): add custom functions documentation for AWS Amplify-backend #8176

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

MarlonJD
Copy link

… Gen 2 @aws-amplify/amplify-backend/1602

Description of changes:

Add custom runtime documents, it's required for #1602

Related GitHub issue

#1543, #1486

Instructions

Which product(s) are affected by this PR (if applicable)?

  • amplify-backend
  • amplify-ui
  • amplify-studio
  • amplify-hosting
  • amplify-libraries

Which platform(s) are affected by this PR (if applicable)?

  • JS
  • Swift
  • Android
  • Flutter
  • React Native

Please add the product(s)/platform(s) affected to the PR title
amplify-backend

Checks

When this PR is ready to merge, please check the box below

  • Ready to merge

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Copy link
Member

@sobolk sobolk left a comment

Choose a reason for hiding this comment

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

I left two comments around docker and go. But I suggest to wait until @josefaidt gets a chance to review this before making changes.


Now when you run `npx ampx sandbox` or deploy your app on Amplify, it will include your Function.

To invoke your Function, we recommend adding your [Function as a handler for a custom query with your Amplify Data resource](/[platform]/build-a-backend/data/custom-business-logic/). This will enable you to strongly type Function arguments and the return statement, and use this to author your Function's business logic. To get started, open your `amplify/data/resource.ts` file and specify a new query in your schema:
Copy link
Contributor

Choose a reason for hiding this comment

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

can we reword this to remove the language around strongly typed handlers? that will be a typescript-specific feature

Copy link
Author

Choose a reason for hiding this comment

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

Actually, it's just works as handler, it's important use case for Python or Go. It would be nice to have an example here.

Copy link
Contributor

@josefaidt josefaidt left a comment

Choose a reason for hiding this comment

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

Hey @MarlonJD thank you for taking the time to write this up!! I left a few comments to adjust some of the language used but overall this looks great!

…orrecting capitalization and enhancing clarity
@MarlonJD
Copy link
Author

MarlonJD commented Jan 7, 2025

Hi @josefaidt,
Thank you so much for your kind words and for taking the time to review this!
I really appreciate your feedback and have made adjustments based on your comments to refine the language. Please let me know if there’s anything else you'd like to tweak or improve further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants