I'm building an application with Amplify and using DataStore.
I have a set of data in a data model called "Location" that I created several days ago and I was using it with DataStore.query but all of a sudden the data stopped coming back. I went to look at the Content tab in Amplify Studio and it wasn't there so I thought maybe it was dropped for some reason.
But the data still exists in DynamoDB, is queryable in GQL, but is not visible in DataStore or the Content page in Studio.
I have no idea what could cause this. The data looks complete--it's got the Amplify fields like createdAt, updatedAt, etc.
Here's another clue--when I first noticed them disappear I went and manually created one and it worked fine for a day or so but now it's gone. What can cause this?
(BTW, the DataStore query is this: return await DataStore.query(Location);
)
Update
So, new information. This started when I added a new model called DeviceLocationFollow
with two @hasOne
relationships to the Device
and Location
table. (I am not using a @manyToMany
because I wanted to add the extra follow
field).
When I delete the records from this third table it disables the ability to see the referenced records, but the records otherwise seem fine.
type DeviceLocationFollow @model @auth(rules: [{ allow: public }]) {
id: ID!
location: Location @hasOne
device: Device @hasOne
follow: FollowType!
}