【发布时间】:2019-05-24 11:10:54
【问题描述】:
我一直在尝试将 getquery 与 react 一起使用,但我无法让它工作。下面是我整理的代码
const input = {
id: this.props.Id
};
return (
<div>
<Connect
query={graphqlOperation(getRecords, input)}
subscription={graphqlOperation(onCreateRecords)}
onSubscriptionMsg={onNewRecord}
>
{({data, loading, error}) => {
if (loading) return "Loading"
if (error) return "Error"
const ListRecord = data.getRecords
console.log('ListRecord', ListRecord)
//console.log returns undefined
return <div>...
</div>
}}
</Connect>
</div>
Deos 有人知道我做错了什么吗?谢谢!
【问题讨论】:
标签: reactjs amazon-dynamodb aws-amplify aws-appsync