Describe the bug
Hi there, I am getting the following error when running amplify mock: Failed to start API Mock endpoint ValidationException: The number of attributes in key schema must match the number of attributesdefined in attribute definitions.
To Reproduce
schema.graphql
type Customer
@model
@key(fields: ["id", "updatedAt"])
@key(name: "BySpending", fields: ["id", "totalSpending"])
@key(name: "ByAttendance", fields: ["id", "totalAttendance"])
@auth(rules: [{ allow: owner }, { allow: groups, groups: ["Admin"] }]) {
id: ID!
...
totalSpending: Int!
totalAttendance: Int!
...
entries: [Entry] @connection(name: "CustomerEntries")
...
owner: ID!
createdAt: AWSDateTime
updatedAt: AWSDateTime!
}
Expected behavior
Create two LSI and start AppSync Mock service.
The schema above should have met the LSI requirement:
Every local secondary index must meet the following conditions:
- The partition key is the same as that of its base table.
- The sort key consists of exactly one scalar attribute.
- The sort key of the base table is projected into the index, where it acts as a non-key attribute.
Screenshots
It seems OK when pushing to cloud
Desktop (please complete the following information):
Additional context
related #1725 #2059
Same error.
I can reproduce this error, too.
Most helpful comment
I can reproduce this error, too.