ashhitch / wp-graphql-yoast-seo

This is an extension to the WPGraphQL plugin for Yoast SEO
GNU General Public License v3.0
226 stars 48 forks source link

isPrimary not exposed to ReactJS/Gatsby #117

Closed charles-langley closed 2 years ago

charles-langley commented 3 years ago

We're working on a headless wordpress project using react js/gatsby, and while your plugin exposes isPrimary to the internal wpgraphql plugin, when attempting to access the information through gatsby graphql queries, isPrimary doesn't exist.

All of the other seo data provided by your plugin appears to be there, just not isPrimary.

ashhitch commented 3 years ago

Hi, this is because Gatsby does not pull in fields on the edge node.

I'll leave this open to see if I can think of another solution.

charles-langley commented 3 years ago

Would it be possible to move it into 'seo'? For example:

query MyQuery {
  allWpPost {
    edges {
      node {
        categories {
          nodes {
            seo {
              isPrimary
            }
          }
        }
      }
    }
  }
}
github-actions[bot] commented 2 years ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days