Skip to content

feat(amplify-category-api): keep datastore fields when disabling datastore#3475

Open
cadivus wants to merge 4 commits intorelease-api-plugin-stablefrom
feat/preserve-sync-fields-on-disable
Open

feat(amplify-category-api): keep datastore fields when disabling datastore#3475
cadivus wants to merge 4 commits intorelease-api-plugin-stablefrom
feat/preserve-sync-fields-on-disable

Conversation

@cadivus
Copy link
Copy Markdown
Member

@cadivus cadivus commented Apr 28, 2026

Needed to e.g. filter for soft deleted data when disabling datastore

Description of changes

CDK / CloudFormation Parameters Changed

Issue #, if available

Description of how you validated changes

Checklist

  • PR description included
  • yarn test passes
  • E2E test run linked
  • Tests are changed or added
  • Relevant documentation is changed or added (and PR referenced)
  • New AWS SDK calls or CloudFormation actions have been added to relevant test and service IAM policies
  • Any CDK or CloudFormation parameter changes are called out explicitly

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

…store

Needed to e.g. filter for soft deleted data
@cadivus cadivus requested a review from a team as a code owner April 28, 2026 15:19
@adrianjoshua-strutt adrianjoshua-strutt self-assigned this Apr 28, 2026
}) => {
if (node.name.value !== typeName) return undefined;
for (const field of node.fields ?? []) {
const scalar = field.type.kind === 'NamedType' && field.type.name ? field.type.name.value : '';
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The code only checks field.type.kind === 'NamedType' when detecting existing sync fields. If someone has _version: Int! in their schema, the NonNullType wrapper means it won't be recognized. We should do a recursive check here.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Does the fix work for you?

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