GraphQL schema for DynamoDB

0

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 3 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!
}



No Answers

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions