aws-amplify

React useEffect infinite loop

血红的双手。 提交于 2020-04-30 08:45:28
问题 I was experimenting with React a little and wanted to retrieve a json file I had on S3 bucket. I'm using the next code import React, { useState, useEffect } from "react"; import { Storage } from "aws-amplify"; export default function Gallery(props){ const [picList, setPicList] = useState([]); useEffect(() => { async function onLoad() { try{ const picUrl = await Storage.get('list.json'); const picr = await fetch(picUrl); const picjs = await picr.json(); setPicList(picjs); console.log(picList);

Amplify configure

社会主义新天地 提交于 2020-04-30 06:57:06
问题 I have installed 'amplify-cli'. When I type 'amplify configure', I get the error message: 'amplify is not recognized as an internal or external command, operable program or batch file'. 回答1: Please share your platform. Are you developing on Linux, Windows (Powershell), or Linux on Windows (WSL/Ubuntu)? Did you install the CLI globally? Try this: npm install -g @aws-amplify/cli And see if that works. If the global install fails, you can try running this per an Amplify developer: npm install -g

AppSync/Amplify Query using a Parameter Error “”Validation error of type FieldUndefined:"

微笑、不失礼 提交于 2020-04-18 05:36:51
问题 I currently have a AppSync schema where I created a separate query within the AppSync console in order retain certain parameter (assetId) and get a list of the results in my DynamoDB table. I have tested the query already within the AppSync console and it works fine, I am now just having troubles using Amplify in my React App in order to call the query. I get the following error when running my App: DisplayCard.js:34 Uncaught (in promise) {data: null, errors: Array(1)} "Validation error of

How to Filter List/Queries With AND/OR operators AWS Amplify JavaScript GraphQL

两盒软妹~` 提交于 2020-04-16 02:33:14
问题 I am new to using AWS Amplify and GraphQL. Also just started building out React Native App - which is a lot of fun! I have a table called TimePeriods schema for it looks like this type TimePeriod @model { id: ID! name: String! startYear: String! endYear: String!, artworks: [ArtWorkTimePeriod] @connection (name: "TimePeriodArtWorks") #Many to Many Relationship artists: [ArtistTimePeriod] @connection (name: "TimePeriodArtists") #Many to Many Relationship } In the queries file generated by

How to Filter List/Queries With AND/OR operators AWS Amplify JavaScript GraphQL

旧巷老猫 提交于 2020-04-16 02:33:09
问题 I am new to using AWS Amplify and GraphQL. Also just started building out React Native App - which is a lot of fun! I have a table called TimePeriods schema for it looks like this type TimePeriod @model { id: ID! name: String! startYear: String! endYear: String!, artworks: [ArtWorkTimePeriod] @connection (name: "TimePeriodArtWorks") #Many to Many Relationship artists: [ArtistTimePeriod] @connection (name: "TimePeriodArtists") #Many to Many Relationship } In the queries file generated by

Angular PWA doesn't update in production

a 夏天 提交于 2020-04-14 07:25:08
问题 I have a PWA in Angular 8. I have added $ ng add @angular/pwa , and the PWA functionality seems to work, accept for this problem: when I push a new build to production, the app is not updated on people's browsers (tested on Chrome and mobile Safari). Instead, when a user opens their browser to go to the app, he/she will see the previous (non-updated) version of the app that was previously on their browser. They will only see the newer version if they refresh the page. No errors are shown. I

Angular PWA doesn't update in production

烂漫一生 提交于 2020-04-14 07:24:42
问题 I have a PWA in Angular 8. I have added $ ng add @angular/pwa , and the PWA functionality seems to work, accept for this problem: when I push a new build to production, the app is not updated on people's browsers (tested on Chrome and mobile Safari). Instead, when a user opens their browser to go to the app, he/she will see the previous (non-updated) version of the app that was previously on their browser. They will only see the newer version if they refresh the page. No errors are shown. I

How to add an additional endpoint to the AWS Amplify Express Server?

爷,独闯天下 提交于 2020-03-28 06:41:51
问题 I've generated an REST express server with Amplify. I tried adding to more endpoints to it: // using serverless express app.post('/myendpoint', function(req, res) { console.log('body: ', req.body) res.json(req.body) }); // using serverless express app.get('/myendpoint', function(req, res) { res.json({success: 'get call to my endpoint succeed!', url: req.url}); }); After running amplify push I don't see these endpoints in the console, and I can't make requests to them via amplify. The

How can I get started with integrating AWS Amplify to a Nuxt.js project?

落花浮王杯 提交于 2020-03-22 09:43:31
问题 Im recently started working with vue and nuxt. I want to add an AWS backend to my project. I've seen that Amplify is useful but haven't been able to find any resources on how to implement it in nuxt. Any advice? 回答1: I'm trying to implement as well AWS services as a backend for an app I'm working on. I managed to get a basic setup working with my Nuxt app doing the following steps. 1.- Create a Amplify Plugin File. (plugins/amplify.js) import Vue from 'vue' import Amplify, * as AmplifyModules

Multiple subscriptions in AWS Amplify react Connect component

我与影子孤独终老i 提交于 2020-01-23 03:32:12
问题 I have a list of todo items and I would like to receive notifications when items are added or deleted from the list. So far I have implemented item addition notification: <Connect query={graphqlOperation(listTodos)} subscription={graphqlOperation(onCreateTodo)} onSubscriptionMsg={(prev, { onCreateTodo }) => { return addItem(prev, onCreateTodo) }} > {({ data: { listTodos }, loading, error }) => { if (loading) return "Loading" if (error) return "Error" return listTodos.items .map(({ id, name })