0👍
✅
I just changed ‘id’ to ‘blogId’ and now it works fine.
setup(props){
const {result, error, loading, refetch} = useQuery(gql`
query getBlogById($blogId: ID!){
blog(blogId: $blogId){
id,
title,
author,
body,
dataPublished
}
}
`, () => ({
blogId: props.blogId,
}))
const blog = useResult(result, null, data => data.blog)
return { blog, error, loading, refetch}
}
Source:stackexchange.com