gatsbyjs / gatsby-source-wordpress-experimental

The upcoming v4 of gatsby-source-wordpress, currently in beta
MIT License
385 stars 100 forks source link

Query Page template #347

Closed rcapdepaula closed 3 years ago

rcapdepaula commented 3 years ago

Whats's is going wrong to query page?

query ($id: String!,  
  $parent: Int, 
  $wpId: Int) {
  currentPage: wpPage(id: {eq: $id}) {
    title
    content
    featuredImage {
      node {
        altText
        localFile {
          childImageSharp {
            fluid(maxWidth: 1000, quality: 100) {
              ...GatsbyImageSharpFluid_withWebp
            }
          }
        }
      }
    }
  }
  parentChildren: allWpPage(filter: {wpParent: {eq: $parent}}) {
    edges {
      node {
        id
        title
        link
      }
    }
  }
  children: allWpPage(filter: {wpParent: {eq: $wpId}}) {
    edges {
      node {
        id
        title
        link
      }
    }
  }
  parent: wpPage(id: {eq: $parent}) {
    title
    link
  }
}
TylerBarnes commented 3 years ago

Hi @rcapdepaula , can you elaborate a bit? Ideally we need a full description of what the problem you're experiencing is as well as a minimal reproduction of the problem and access to a public /graphql url.

Thanks!