I’m using DynamoDB and want to create a database with GraphQL API.
How do I have to define my schema so my partition key is userID and my sort key is MMYY.
Every userID has a lot of MMYY, and every MMYY has entries which are just some data.
I want all of these entities to be in 1 table.
Is this the right way?
input AMPLIFY {
globalAuthRule: AuthRule = { allow: public }
}
type UserID @model {
userID: ID! # Assuming userID is the partition key
mmYYEntries: [MMYY] @hasMany
}
type MMYY @model {
userID: ID! # Assuming userID is the partition key
MMYY: Int! # Assuming MMYY is the sort key and it's a whole number
entries: [Entry] @hasMany
}
type Entry @model {
dt: Int!
bl: Int!
bs: String!
ss: Int!
}