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: allow CustomType and RefType in arguments #387

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

vaisshnavi7
Copy link
Contributor

Description of changes: This PR allows the use of CustomType and RefType in arguments for custom operations in the @aws-amplify/data-schema package. Specifically:

  1. Updated CustomOperation.ts to accept CustomType and RefType in CustomArguments.
  2. Modified bridge-types.ts to include CustomType and RefType in relevant interfaces.
  3. Added type tests in CustomOperations.test-d.ts to verify the new functionality.

These changes enhance the flexibility of schema definitions by allowing more complex argument structures in custom operations.

Testing:

  • Added new type tests in CustomOperations.test-d.ts
  • Manually verified using a test schema that correctly generates CustomType and RefType arguments

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

@vaisshnavi7 vaisshnavi7 requested a review from a team as a code owner November 8, 2024 01:59
Copy link

changeset-bot bot commented Nov 8, 2024

🦋 Changeset detected

Latest commit: 45074a3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@aws-amplify/data-schema Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vaisshnavi7 vaisshnavi7 marked this pull request as draft November 8, 2024 02:14
@vaisshnavi7
Copy link
Contributor Author

This PR is currently in draft because the unit test check failed. I'm investigating the issue and will update the PR once resolved.

@vaisshnavi7 vaisshnavi7 marked this pull request as ready for review November 11, 2024 18:06
Copy link
Member

@svidgen svidgen left a comment

Choose a reason for hiding this comment

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

Let's actually establish a feature branch and/or a branch for tagged releases instead of merging to main for now. I think this would leave main in a broken state (or at least an "odd" state) if the type changes are released ahead of the implementation changes. I.e., we'd be exposing a builder type that either fails or does nothing. And, I think in this case it would actually fail if these builder methods were called. Is that correct?

@vaisshnavi7
Copy link
Contributor Author

Good point, @svidgen. I’ll set up a feature branch to keep main stable and ensure all builder methods align with the type changes. Appreciate the insight!

@vaisshnavi7 vaisshnavi7 marked this pull request as draft November 13, 2024 20:51
@vaisshnavi7 vaisshnavi7 changed the title feat(custom-operations): allow CustomType and RefType in arguments feat: allow CustomType and RefType in arguments Nov 20, 2024
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.

2 participants