Note: if we want to add FGAC to any of the fields in the schema we could use the transformer directive - for more detail on access control, transformer directives and - by Brice Pelle. We simply add a new String type called image - which will hold our image name when we persist an image and an image pre-signedURL when we retrieve an image. You can find the schema definition under. The next step is to add the concept of an image to our GraphQL schema definition. Note - most of these are defaults apart from the 'Who should have access' question where I have selected Auth users only and given them full CRUD privilege. This is super easy to do by running the amplify add storage command in the terminal and selecting the following options So, nothing too tricky here, what we are going to add to this app is the ability to save images to our cloud backend when in the 'create view' and the ability to see those images in the 'list view'.Īdding the image concept to backend resources.įirst thing is confirming what amplify feature categories we have installed - to find this out we simply run the amplify status command which gives the following outputĪs you can see, we have both auth and api feature categories installed - so that means that there is an Amazon Cognito instance handling users and auth, an AWS Appsync instance handling the GraphQL API and an Amazon DynamoDB instance handling data persistence.įirst thing is to add the new Storage feature category to this existing backend. A list of Todo's that have already been created.Ĭlicking on 'New To Do' button on the 'list view' will bring you to the 'create view' and once a new todo has been created the app will navigate back to the 'list view' from the 'create view'.The base application we will be adding photo/image storage to should look something like the below image. Note - if you do end up cloning the repo, remember to run 'amplify configure' and 'amplify init' to re-configure the project to a new cloud back end in your own AWS account. You can follow along with this creation by going to the official Amplify react-native docs. I will also be working off an existing AWS backend application that has already been created with the AWS Amplify CLI and has had both the 'auth' and 'api' feature categories added. This blog assumes that the reader is familiar with AWS Amplify and its feature categories, however if you are not familiar then please have a read of this great intro by of our AWS community members. In this blog post I will detail how to leverage AWS Amplify, AWS Appsync and Amazon S3 to provide an image upload capability into a react native app.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |