1 Answer
- Newest
- Most votes
- Most comments
0
I thought of sharing my approach to this, I used a Global Secondary Key (GSI) in the CITY table so I could query the cities by country_code (see below). I then used pagination to gather the remaining cities since the API does not return more than 1MB of data. I really like this video from YouTube that explains the difference between Scan and Query for those that are just getting started.
type CITY @model {
id: ID!
country_code: String! @index(name: "byCountry", queryField: "listCitiesbyCountry")
name: String!
code: String!
state: String
...
}
answered a year ago
Relevant content
- asked a year ago
- asked 5 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago