DEV Community

Discussion on: Building a Serverless JAMstack ECommerce Store with Gatsby & AWS Amplify

Collapse
 
osaosemwen profile image
Ose M. Osamudiamen

Very good article, Nader. well descriptive. Thanks.

Please, I have a couple of issues:

  1. How do I control the site from reloading the whole application whenever there is any change in the code.
  2. How do I solve this bug ? It generates when I try loading a picture in the application. an attachment can be seen for the error.

Unhandled Rejection (TypeError): aws_amplify_WEBPACK_IMPORTED_MODULE_9_.API.grapghql is not a function
_callee2$
localhost:8000/commons.js:281286:70
281283 | categories: categories.replace(/\s/g, "").split(',')
281284 | });
281285 | _context2.next = 6;

281286 | return aws_amplify_WEBPACK_IMPORTED_MODULE_9["API"].grapghql(Object(aws_amplifyWEBPACK_IMPORTED_MODULE_9["graphqlOperation"])(_graphql_mutationsWEBPACK_IMPORTED_MODULE_10_["createProduct"], {
| ^ 281287 | input: item
281288 | }));
281289 |

the source code error:
Unhandled Rejection (TypeError): aws_amplify_WEBPACK_IMPORTED_MODULE_9_.API.grapghql is not a function
_callee2$
src/components/formComponents/AddInventory.js:29
26 | // })
27 | // this.setState({ image: storageUrl })
28 | }

29 | addItem = async () => {
30 | const { name, brand, price, categories, image, description, currentInventory } = this.state
31 | if (!name || !brand || !price || !categories.length || !description || !currentInventory || !image) return
32 | // create the item in the database.

  1. I also realize that when I try to update the code 'fetchImage' function in the file image.js as suggested, the images would not load up. but when I revert to its initial state it loads up.

Sorry I asked 3 questions in one, issue is, I am hurrying up to round up this task so I move on to integration of financial-payment solutions (stripe and others).

Thanks