Open SanjayGitHub00 opened 3 years ago
Please check if you have installed all the plugins described in the README and check your code against this branch https://github.com/imranhsayed/nextjs-headless-wordpress/tree/feature/youtube-tutorial
Hi @SanjayGitHub00 and @ imranhsayed
I am far from an expert in graphql queries, but I do not understand the last few lines in the get-menus.js file?
export const GET_MENUS = gql`
query GET_MENUS {
${HeaderFooter}
}
${MenuFragment}
`
Is it really possible to do a fragment (MenuFragment) outside of the query like this?
To me it looks like a small typo.
Hi @SanjayGitHub00 and @ imranhsayed
I am far from an expert in graphql queries, but I do not understand the last few lines in the get-menus.js file?
export const GET_MENUS = gql` query GET_MENUS { ${HeaderFooter} } ${MenuFragment} `
Is it really possible to do a fragment (MenuFragment) outside of the query like this?
To me it looks like a small typo.
try it and see the result
This is my header component -- ` import { isEmpty } from "lodash"; import Nav from "./Nav";
const Header = ({ headerMenus }) => { // console.log(headerMenus); <- Here i get the menus if (isEmpty(headerMenus)) { return null; } return (
//<Header> // <Nav headerMenus = {headerMenus}/> // </Header>
); }; export default Header; ` when I send data through props to nav I am not getting any data in nav component please help here the code of Nav` const Nav = ({headerMenus}) =>{ // console.log(headerMenus); <~~ Not getting data here so i can't return anything through this
return; }; export default Nav; `
Same problem ! I already install all plugins but I'm not getting data
This is my header component -- ` import { isEmpty } from "lodash"; import Nav from "./Nav";
const Header = ({ headerMenus }) => { // console.log(headerMenus); <- Here i get the menus if (isEmpty(headerMenus)) { return null; } return (
//<Header> // <Nav headerMenus = {headerMenus}/> // </Header>
); }; export default Header; ` when I send data through props to nav I am not getting any data in nav component please help here the code of Nav` const Nav = ({headerMenus}) =>{ // console.log(headerMenus); <~~ Not getting data here so i can't return anything through this
return; }; export default Nav; `