Skip to Content
풀스택 서버리스: 리액트, AWS, 그래프QL을 이용한 최신 애플리케이션 개발
book

풀스택 서버리스: 리액트, AWS, 그래프QL을 이용한 최신 애플리케이션 개발

by 김범준, 네이더 다빗
July 2021
Beginner to intermediate
216 pages
4h 26m
Korean
Hanbit Media, Inc.
Content preview from 풀스택 서버리스: 리액트, AWS, 그래프QL을 이용한 최신 애플리케이션 개발
198
풀스택 서버리스
const signedUrl = await Storage.get(item.imageKey)
item.imageUrl = signedUrl
return item
})
)
return signedPosts
}
function Posts() {
const [posts, dispatch] = useReducer(reducer, [])
useEffect(() => {
fetchPosts()
const subscription = API.graphql(graphqlOperation(onCreatePost)).subscribe({
next: async post => {
const newPost = post.value.data.onCreatePost
const signedUrl = await Storage.get(newPost.imageKey)
newPost.imageUrl = signedUrl
dispatch({ type: 'ADD_POST', post: newPost })
}
})
return () => subscription.unsubscribe()
}, [])
async function fetchPosts() {
const postData = await API.graphql(graphqlOperation(listPosts))
const { data: { listPosts: { items }}} = postData
const signedPosts = await getSignedPosts(items)
dispatch({ ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

실전 시계열 분석: 통계와 머신러닝을 활용한 예측 기법

실전 시계열 분석: 통계와 머신러닝을 활용한 예측 기법

박찬성, 에일린 닐슨

Publisher Resources

ISBN: 9791162244487