I am working with AWS amplify for the first time by following the docs. Everything is working except deletion of the data. Whenever I try to delete data from any of my table it gives the error
DOMException: Failed to execute 'index' on 'IDBObjectStore': The specified index was not found. at Proxy. (http://localhost:3000/static/js/bundle.js:34280:22) at IndexedDBAdapter. (http://localhost:3000/static/js/bundle.js:25458:82) at step (http://localhost:3000/static/js/bundle.js:23678:17) at Object.next (http://localhost:3000/static/js/bundle.js:23609:14) at fulfilled (http://localhost:3000/static/js/bundle.js:23563:24)
I have tried using all the ways mentioned in the amplify datastore docs, but I always get this error. Following is my graphql schema
type Profile @model @auth(rules: [{allow: groups, groups: ["SME"], operations: [read]}, {allow: owner}]) {
email: String!
name: String
birthDate: String
photo: String
answers: [Answer!] @hasMany
}
type Questionnaire @model @auth(rules: [{allow: private, operations: [read]}, {allow: groups, groups: ["SME"], operations: [create, read, update, delete]}]) {
detail: String!
fields: [Field!] @hasMany
next: Questionnaire @hasOne
previous: Questionnaire @hasOne
}
type Field @model @auth(rules: [{allow: private, operations: [read]}, {allow: groups, groups: ["SME"], operations: [create, read, update]}]) {
question: Questionnaire! @belongsTo
label: String!
options: [String!]!
units: [Units]
answers: [Answer!] @hasMany
}
type Answer @model @auth(rules: [{allow: groups, groups: ["SME"], operations: [read]}, {allow: owner, operations: [create, read, update]}]) {
field: Field! @belongsTo
answers: [String!]!
unit: Units
}
enum Units {
cm
in
ft
kg
lb
sec
min
hrs
days
weeks
months
}
I have set cognito userpool as default authorization type and conflict resolution to "merge".