postedin/yarpp-wpgraphql

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

Installs: 230

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 3

Type:wordpress-plugin

1.1.0 2022-09-06 13:36 UTC

This package is auto-updated.

Last update: 2024-04-06 16:47:46 UTC


README

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