fix: treating id field as implicit primary key which we miss today #2008
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of changes
The primary key transformer does not recognize the default
id: ID!
field on a model as implicit primary key and hence does not generate any resolvers for that field. One of the issues arising this is that thepreAuth
slot for Sync Queries is not generated which causes the Sync to be slow as it scans the whole table even if the filter is specified on theid
field by the customers. Other side effects include missingpre-Auth
slots that set the primary key information for CRUD operation resolvers for the models.Please see the snapshot changes for the full change set.
This could be a breaking change since we're generating several new resolver slots and their overall evaluation might break existing apps.
CDK / CloudFormation Parameters Changed
Issue #, if available
Description of how you validated changes
Checklist
yarn test
passesBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.