I'm defining a simple schema for AWS Amplify in Flutter. Something like this:
type Marker {
start: Float!
end: Float!
}
type DataPoints @model {
id: ID!
name: String!
description: String!
markers: [Marker!]!
}
The point is that Markers
s are just simple objects to exist within other objects, and they are never saved directly to the DataStore. Code generation works fine, but at runtime the program crashes saying essentially that Marker
needs to have a primary key like id
. If I then change Marker
to have an id: ID!
field, it works just fine. But there's no need to have a key on the object, since it just used for nested data.
Are all type classes required to have a primary key regardless of whether they are independent objects? Or is there some way to have the code generator emit simple objects that don't need to be actual model objects?