Skip to content

Latest commit

 

History

History
36 lines (32 loc) · 907 Bytes

readme.md

File metadata and controls

36 lines (32 loc) · 907 Bytes

YARPP WPGraphQL

Description

Creates a relatedPosts field in Post type with wp-graphql. You must have installed wp-graphql and YARPP.

Installation

  1. Install the plugin wp-graphql
  2. Install the plugin yarpp (Yet Another Related Posts Plugin)
  3. Configure them following their instructions.
  4. Install this plugin
  5. Activate the plugin through the 'Plugins' menu in WordPress
  6. Use it with wp-graphql. The field "relatedPosts" will be available within the Post type in GraphQL schema.

Example

{
  post(id: 235912, idType: DATABASE_ID) {
    title
    relatedPosts(where: { limit: 1 }) {
      nodes {
        title
        slug
      }
    }
  }
}

Changelog