Closed dpilch closed 5 months ago
respectReferences
Example:
type Primary @model { tenantId: ID! @primaryKey(sortKeyFields: ["instanceId", "recordId"]) instanceId: ID! recordId: ID! content: String related: [Related!] @hasMany(references: ["primaryTenantId", "primaryInstanceId", "primaryRecordId"]) } type Related @model { content: String primaryTenantId: ID! primaryInstanceId: ID! primaryRecordId: ID! primary: Primary @belongsTo(references: ["primaryTenantId", "primaryInstanceId", "primaryRecordId"]) }
The .hasMany on the generated model for native platforms will use associatedWith: primary instead of associatedWith: ["primaryTenantId", "primaryInstanceId", "primaryRecordId"]. This is how composite primary keys work for native currently.
.hasMany
associatedWith: primary
associatedWith: ["primaryTenantId", "primaryInstanceId", "primaryRecordId"]
N/A
yarn test
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Description of changes
respectReferences
and enable references for all platformsExample:
The
.hasMany
on the generated model for native platforms will useassociatedWith: primary
instead ofassociatedWith: ["primaryTenantId", "primaryInstanceId", "primaryRecordId"]
. This is how composite primary keys work for native currently.Codegen Paramaters Changed or Added
N/A
Issue #, if available
N/A
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.