/private/${cognito-identity.amazonaws.com:sub}/
could be ok, but I forgot to mention that the cognito admin group must be able to write in both of those "folders".I have the documentation schema.graphql
type Customer @model @key(fields: ["email"]) {
email: String!
username: String
}
I run amplify mock api
and run the mutation
createCustomer(input: {email: "bob@bob.com", username: "bob"}) {
email
username
}
I get the result:
Error while executing Local DynamoDB
...
ValidationException: One of the required keys was not given a value
amplify mock api
gets confused if you change tables and keys too often, I had to manually delete the mock dynamodb table file and let amplify mock api
rebuild a new one
in the example from the GraphQL transform documentation:
type Customer @model
@key(name: "byRepresentative", fields: ["accountRepresentativeID", "id"], queryField: "byRepresentative") {
id: ID!
accountRepresentativeID: ID!
...
}
Is there any difference between that and this different GSI (with no sort key "id")?
type Customer @model
@key(name: "byRepresentative", fields: ["accountRepresentativeID"], queryField: "byRepresentative") {
id: ID!
accountRepresentativeID: ID!
...
}
@key
directive
accountRepresentativeID
alone would be fine for that use case
federatedSignIn
?
Hey all! I'm trying to add the @key
directive to an existing model, but getting the following error:
✖ An error occurred when pushing the resources to the cloud
Attempting to edit the key schema of the ImageTable table in the Image stack.
An error occured during the push operation: Attempting to edit the key schema of the ImageTable table in the Image stack.
I'm not sure why that's happening?
My updated schema.graphql:
// amplify/backend/api/chainappterparty/schema.graphql
type Image @model @key(fields: ["createdAt"]) {
id: ID!
long: String!
lat: String!
image: String!
createdAt: String!
}
Previous schema.graphql:
type Image @model {
id: ID!
long: String!
lat: String!
image: String!
}
@key(fields: ["id", "createdAt"])
to make id
the partition key and createdAt
the sort keyamplify publish
and it runs, but som resources fail to deploy. Some resolvers fail, and then this one comes up:Resource Name: Image-uf7b2g3cyzbafnojjoi6x35gj4 (AWS::DynamoDB::Table)
Event Type: update
Reason: CloudFormation cannot update a stack when a custom-named resource requires replacing. Rename Image-uf7b2g3cyzbafnojjoi6x35gj4-master and update the stack again.