Skip to content

Conversation

@ahmedhamouda78
Copy link
Member

@ahmedhamouda78 ahmedhamouda78 commented Oct 20, 2025

Description of changes

This PR adds projection support for the @index directive in Amplify GraphQL API. The changes enable developers to specify which fields should be projected in DynamoDB Global Secondary Indexes (GSI) when using the @index directive, providing better control over query performance and cost optimization.

Key changes:

  • Enhanced index directive to support projection configuration
  • Updated GraphQL index transformer to handle projection parameters
  • Modified resolvers to work with projected fields
CDK / CloudFormation Parameters Changed

Issue #, if available

aws-amplify/amplify-data#604

Description of how you validated changes

  • Added unit tests covering projection scenarios in amplify-graphql-index-transformer.test.ts
  • Verified snapshot tests pass with updated index directive behavior
  • Tested resolver functionality with projected fields in sample app

Checklist

  • PR description included
  • yarn test passes
  • E2E test run linked
  • Tests are changed or added
  • 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.

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.

I'm not sure offhand what is or isn't required for the AppSync/resolver side of this. But, I suspect it's more than this. I would actually kind of expect to see some new generated GraphQL types.

Sufficiently thorough e2e tests would give me some confidence this is working as expected either way though.

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.

3 participants