Technical requirements
To follow along with this chapter, you will need to have completed the exercises in all the previous chapters so that you can start adding photos to blog posts. You can download the file for this chapter from the following link: https://github.com/PacktPublishing/Rapid-Application-Development-with-AWS-Amplify/tree/master/ch6.
We will need to change the data model to the following to accommodate the user uploading image alongside the actual blog post. Once we've done this, we'll need to call the amplify push
command to push the new changes to the cloud:
type Post @model @key(fields: ["title"]) { id: ID! title: String! content: String! image: String }
To upload photos to the Amplify Storage backend, we will need to call the amplify add storage
command in a Terminal. This will add Amplify Storage to the cloud's backend:
amplify add storage ? Please select from one of the below mentioned...