Tag: undefined
-
Getting posts undefined in headless wp with graphQl Next.js
0 The graphQL query is working https://trialtest1.local/graphql?query={%20posts%20{%20nodes%20{%20slug%20title%20}%20}} But when I ask for posts in next.js it shows undefined. Can anyone see what Im doing wrong? import Link from ‘next/link’ export default function Home( {posts}){ console.log({posts}) return( <div> <h1>Hello From The Home Page!</h1> { posts?.nodes?.map(post => { return( <ul key={post.slug}> <li> <Link href={`/posts/${post.slug}`}>{post.title}</Link> </li> </ul> )…