GraphQL schema for DynamoDB

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


Load 6 more related questions


Show fewer related questions

0



Leave a Reply

Your email address will not be published. Required fields are marked *