Giter Site home page Giter Site logo

ashhitch / wp-graphql-yoast-seo Goto Github PK

View Code? Open in Web Editor NEW
214.0 9.0 49.0 867 KB

This is an extension to the WPGraphQL plugin for Yoast SEO

License: GNU General Public License v3.0

PHP 99.87% Shell 0.13%
wpgraphql-plugin yoast-seo wordpress wordpress-plugin graphql hacktoberfest

wp-graphql-yoast-seo's Introduction

WPGraphQl Yoast SEO Plugin

Latest Stable Version Total Downloads Monthly Downloads

WPGraphQl Yoast SEO Plugin

Please note version 14 of the Yoast Plugin is a major update.

If you are stuck on version of Yoast before V14 then use v3 of this plugin.

This is an extension to the WPGraphQL plugin (https://github.com/wp-graphql/wp-graphql) that returns Yoast SEO data.

Using this plugin? I would love to see what you make with it. πŸ˜ƒ @ash_hitchcock

Currently returning SEO data for:

  • Pages
  • Posts
  • Custom post types
  • Products (WooCommerce)
  • Categories
  • Custom taxonomies
  • WooCommerce Products
  • Yoast Configuration
    • Webmaster verification
    • Social profiles
    • Schemas
    • Breadcrumbs

If there is any Yoast data that is not currently returned, please raise an issue so we can add it to the roadmap.

Quick Install

  • Install from the WordPress Plugin Directory
  • Clone or download the zip of this repository into your WordPress plugin directory & activate the WP GraphQL Yoast SEO plugin
  • Install & activate WPGraphQL

Composer

composer require ashhitch/wp-graphql-yoast-seo

Find this useful?

Buy Me A Coffee

Canonicals

Please note canonicals will not be returned if you have the discourage search engines option turned on in your WordPress settings.

V4 breaking change

Plugin now requires at least Yoast 14.0.0

V3 breaking change

Image urls are now returned as mediaItem type.

This applies to twitterImage and opengraphImage

Usage with Gatsby

Checkout the companion Gatsby plugin to add in Metadata and JSON LD schema with ease.

Usage

To query for the Yoast Data simply add the seo object to your query:

Post Type Data

query GetPages {
    pages(first: 10) {
        edges {
            node {
                id
                title
                seo {
                    canonical
                    title
                    metaDesc
                    focuskw
                    metaRobotsNoindex
                    metaRobotsNofollow
                    opengraphAuthor
                    opengraphDescription
                    opengraphTitle
                    opengraphDescription
                    opengraphImage {
                        altText
                        sourceUrl
                        srcSet
                    }
                    opengraphUrl
                    opengraphSiteName
                    opengraphPublishedTime
                    opengraphModifiedTime
                    twitterTitle
                    twitterDescription
                    twitterImage {
                        altText
                        sourceUrl
                        srcSet
                    }
                    breadcrumbs {
                        url
                        text
                    }
                    cornerstone
                    schema {
                        pageType
                        articleType
                        raw
                    }
                    readingTime
                    fullHead
                }
                author {
                    node {
                        seo {
                            metaDesc
                            metaRobotsNofollow
                            metaRobotsNoindex
                            title
                            social {
                                youTube
                                wikipedia
                                twitter
                                soundCloud
                                pinterest
                                mySpace
                                linkedIn
                                instagram
                                facebook
                            }
                        }
                    }
                }
            }
        }
    }
}

Post Taxonomy Data

query GetCategories {
    categories(first: 10) {
        edges {
            node {
                id
                seo {
                    fullHead
                    canonical
                    title
                    metaDesc
                    focuskw
                    metaRobotsNoindex
                    metaRobotsNofollow
                    opengraphAuthor
                    opengraphDescription
                    opengraphTitle
                    opengraphDescription
                    opengraphImage {
                        altText
                        sourceUrl
                        srcSet
                    }
                    twitterTitle
                    twitterDescription
                    twitterImage {
                        altText
                        sourceUrl
                        srcSet
                    }
                    breadcrumbs {
                        url
                        text
                    }
                }
                name
            }
        }
    }
}

User Data

query GetUsers {
    users {
        nodes {
            seo {
                metaDesc
                metaRobotsNofollow
                metaRobotsNoindex
                title
                fullHead
                social {
                    youTube
                    wikipedia
                    twitter
                    soundCloud
                    pinterest
                    mySpace
                    linkedIn
                    instagram
                    facebook
                }
            }
        }
    }
}

Edge and Page Info Data

query GetPostsWithIsPrimary {
    posts {
        pageInfo {
            startCursor
            seo {
                schema {
                    raw
                }
            }
        }
        nodes {
            title
            slug
            categories {
                edges {
                    isPrimary
                    node {
                        name
                        count
                    }
                }
            }
        }
    }
}

Yoast Config Data

query GetSeoConfig {
    seo {
        meta {
            author {
                description
                title
            }
            date {
                description
                title
            }
            config {
                separator
            }
            homepage {
                description
                title
            }
            notFound {
                breadcrumb
                title
            }
        }
        webmaster {
            googleVerify
            yandexVerify
            msVerify
            baiduVerify
        }
        schema {
            siteName
            wordpressSiteName
            siteUrl
            inLanguage
            companyName
            companyOrPerson
            companyLogo {
                mediaItemUrl
            }
            logo {
                mediaItemUrl
            }
            personLogo {
                mediaItemUrl
            }
        }
        breadcrumbs {
            showBlogPage
            separator
            searchPrefix
            prefix
            homeText
            enabled
            boldLast
            archivePrefix
            notFoundText
        }
        social {
            facebook {
                url
                defaultImage {
                    mediaItemUrl
                }
            }
            instagram {
                url
            }
            linkedIn {
                url
            }
            mySpace {
                url
            }
            pinterest {
                url
                metaTag
            }
            twitter {
                cardType
                username
            }
            wikipedia {
                url
            }
            youTube {
                url
            }
            otherSocials
        }
        openGraph {
            frontPage {
                title
                description
                image {
                    altText
                    sourceUrl
                    mediaItemUrl
                }
            }
            defaultImage {
                altText
                sourceUrl
                mediaItemUrl
            }
        }
        contentTypes {
            post {
                title
                schemaType
                metaRobotsNoindex
                metaDesc
                schema {
                    raw
                }

                archive {
                    fullHead
                    archiveLink
                    breadcrumbTitle
                    hasArchive
                    metaDesc
                    metaRobotsNoindex
                    title
                }
            }
            page {
                metaDesc
                metaRobotsNoindex
                schemaType
                title
                schema {
                    raw
                }
            }
        }
        redirects {
            origin
            target
            format
            type
        }
    }
}

contentNode and nodeByUri

contentNode(id: "1", idType: DATABASE_ID) {
    id
    contentTypeName
    seo {
      title
      metaDesc
    }
  }
  node(id: "cG9zdDox",) {
    ... on NodeWithTitle {
      seo {
        title
        metaDesc
      }
    }

  }
  nodeByUri(uri: "/") {
    ... on NodeWithTitle {
      seo {
        title
        metaDesc
      }
    }
  }

Support

Open an issue

Twitter: @ash_hitchcock

Please Note: Yoast and WPGraphQL and their logos are copyright to their respective owners.

wp-graphql-yoast-seo's People

Contributors

ashhitch avatar berryhijwegen avatar bradymwilliams avatar bronsonquick avatar dafky2000 avatar dependabot[bot] avatar giorgiogilbert avatar github-actions[bot] avatar gregrickaby avatar henrikwirth avatar heyjones avatar izzygld avatar jasonbahl avatar jonshipman avatar kent1d avatar kuuak avatar liammartens avatar matepaiva avatar matthewgrzegorczyk avatar pascalroget avatar renatonascalves avatar rodrigo-arias avatar saleebm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wp-graphql-yoast-seo's Issues

Can't fetch frontpage seo

Capture d’écran 2020-11-28 aΜ€ 20 18 41

query MyQuery {
  seo {
    openGraph {
      frontPage {
        title
        description
      }
    }
  }
}

Result in:

{
  "data": {
    "seo": {
      "openGraph": {
        "frontPage": {
          "title": "",
          "description": ""
        }
      }
    }
  },
}

Add authors to schema

Hey,
I see the branch feature/authors available, but is there any reason why the authors are not included with the user object that I am missing? I was hoping to add social links, but not if there is an issue I'm missing. I saw #18 (closed) but there was no info there.

Thank you.

`seo` type already exists.

I'm getting this error (suddenly - so not sure what I did to make it happen). It might have started when I updated WPGraphQL and I was caching some layer somewhere.

You cannot register duplicate fields on the same Type. The field 'seo' already exists on the type 'tag'. Make sure to give the field a unique name

This seems to happen because the RootQuery has seo along with post_types and taxonomies. I edited the code to say something like seoConfig, postTypeSeo and taxSeo but didn't want to open a PR because that would be a breaking change.

There might be something else I'm unaware of?

Unable to install wp-graphql-yoast-seo using composer

I'm trying to install this plugin using composer on one of my websites. But, I'm unable to do so as I'm getting this error.

  [Composer\Downloader\TransportException]                                                                  
  Invalid credentials for 'https://my.yoast.com/packages/p2/ashhitch/wp-graphql-yoast-seo.json', aborting.

I have checked my credentials multiple times but to no avail. I have also tried using both the username and password as well as token but still, the credentials are showing as invalid.

Screenshot 2021-04-15 at 6 47 09 PM

This is my composer version
Composer version 2.0.11 2021-02-24 14:57:23

Please help find that what could be the possible cause for this error?
Thank you!

Introduce WordPress VIP coding standards and fixes for existing errors

See this ticket as a main reference and for discussions: wp-graphql/wp-graphql#1535

WordPress VIP has pretty high coding standards and everyone who will work with VIP in the future will face the same problems as our team right now. It would be great if we could get coding standards up and running with VIP's standards.

Ideally we could setup PHP_Codesniffer with all the configurations of them and let a bot check run through it before merging PRs.

We will attempt to setup everything and also fix major errors, so that we will be able to use WPGraphQL in the future. It would be great if some maintainers can share some of their attention on this, so we don't end up breaking stuff.

Also this is obviously open for discussion, we would just use that PR for our purposes anyways, but would greatly appreciate if it would make it into the main repos best practices.

References:

Setup testing

As the project grows in size and popularity it would be good to set up some formal tests.

Bump Composer Requirements

I'm getting the following when trying to composer require ashhitch/wp-graphql-yoast-seo:

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for ashhitch/wp-graphql-yoast-seo ^2.1 -> satisfiable by ashhitch/wp-graphql-yoast-seo[v2.1.0].
    - ashhitch/wp-graphql-yoast-seo v2.1.0 requires wp-graphql/wp-graphql ^0.3.8 -> satisfiable by wp-graphql/wp-graphql[v0.3.8] but these conflict with your requirements or minimum-stability.

Installation failed, reverting ./composer.json to its original content.

My project requires "wp-graphql/wp-graphql": "^0.4.2" in order to use wp-graphql/wp-graphql-acf, which has a minimum requirement of "wp-graphql/wp-graphql": "^0.4.0".

Is it possible to bump the required version of wp-graphql/wp-graphql within your composer.json?

ProductCategory SEO title not generated correctly.

Hello Guys,

I have been using this plugin and I have noticed the following.

For productCategories in specific I'm currently getting the title in the following format:

48 - product_cat -MySEOTitleOverHere...

So basically every category have this prefix 48 - product_cat - with the database and the word product_cat.

At the moment I'm patching the result on client side to correct this, but seems to be an error.

HTML entities

I'm using WP GraphQL with Next.js and my page titles all have raw HTML entities in them like Page – Site Name

It would make sense for this plugin to decode all HTML entities in strings, right? GraphQL being a data API, it need not concern itself with escaping data, that's the rendering engine's job.

Request: JSON+LD for individual posts.

Yoast puts Json+ld automatically in the article generated by wordpress itself.
It would be awesome if the same Json+ld object is automatically available in the post's seo.

Seo for site?

Hi,
I've installed the plugin. Works great for getting a page's Seo, but it possible to get the global site seo via graphql?

Apply filter to schema.siteUrl

As graphql can be used for headless websites, sometimes the siteUrl is not the same as the get_site_url() result.

If we apply a filter to this value, we open to the possibility to manipulate it right before resolving it to GraphQL. And we don't introduce any breaking change :)

# plugins/wp-graphql-yoast-seo/wp-graphql-yoast-seo.php:710
- 'siteUrl' => wp_gql_seo_format_string(get_site_url()),
+ 'siteUrl' => wp_gql_seo_format_string(apply_filters('wp_gql_seo_site_url', get_site_url())),

Before opening this issue, I tried to add_filter directly to site_url. Although it works, it also breaks other parts of the WordPress panel that uses this global variable. That's why I am now suggesting this approach.

Do you mind if I open a Pull Request with that change? I would love to contribute to this project.


Versions

- "ashhitch/wp-graphql-yoast-seo": "^4.14",
- "wpackagist-plugin/wordpress-seo": "^16.1",

Page SEO returns encoded special characters

Looks like I'm getting encoded special characters for page. Thought this might have been fixed in the past but seems to be broken again.

Here's my query and what it returns.
image

Example shown is requesting titles but same issue occurs when requesting desc's
Let me know if there's anymore more you want me to provide.

Cheers!

Doesn't work when Yoast SEO was activated as MU-plugin

'Yoast SEO' => is_plugin_active( 'wordpress-seo/wp-seo.php' ) || is_plugin_active( 'wordpress-seo-premium/wp-seo-premium.php' );

Because of

function is_plugin_active( $plugin ) { return in_array( $plugin, (array) get_option( 'active_plugins', array() ) ) || is_plugin_active_for_network( $plugin ); }

If Yoast SEO was activated as mu-plugin it doesn't appear in active_plugins option.

Please add a safer check condition

Returning social images

Firstly, great work on the plugin so far.

I had a suggestion around the social images (Open Graph and Twitter) that get returned. It would be great if we could return them as as a meditaItem. At the moment, they're just being returned as strings that point back to the WordPress instance, rather than Gatsby locally.

I had a go at getting this working but couldn't crack it. I figure we could use the type MediaItem rather than String but I just couldn't find enough documentation around what I actually needed to pass to it.

At the moment, I can see the plugin is using _yoast_wpseo_opengraph-image to grab the URL and I also see in the database that _yoast_wpseo_opengraph-image-id is available to get the ID of the media item. Just can't tie it all together. I'll submit a PR though if I get it figured out!

Page & Custom Post SEO Returns Null

The plugin is exposing & returning post SEO fields but not returning field values pages or custom post types. Why can't figure out why.

Using 4.8.0 of the plugin
Yoast version 15.3
WPGraphQL 1.1.3
gatsby-source-wordpress 4.0.1

Example Query:

  pages {
    edges {
      node {
        id
        title
        seo {
          canonical
          title
          metaDesc
          focuskw
          metaRobotsNoindex
          metaRobotsNofollow
          opengraphAuthor
          opengraphDescription
          opengraphTitle
          opengraphDescription
          opengraphImage {
            altText
            sourceUrl
            srcSet
          }
          opengraphUrl
          opengraphSiteName
          opengraphPublishedTime
          opengraphModifiedTime
          twitterTitle
          twitterDescription
          twitterImage {
            altText
            sourceUrl
            srcSet
          }
          breadcrumbs {
            url
            text
          }
          cornerstone
          schema {
            pageType
            articleType
          }
        }
      }
    }
  }
}```

Problem returning excerpt in meta Desc

Using %%excerpt%% as the default description on a custom post type don't return the generated value. In editor & WP frontend it works
image

in my GQL query i get

"seo": {
        "title": "Stable Baselines",
        "metaDesc": "%%excerpt%%",

Any ideas?

SEO - Canonical Support

Hello Guys,

Thanks a lot for this plugin.

I'm currently building an eCom Site and I'm using this plugin to grab Yoast SEO.

Although I have noticed that the canonical configured in Yoast for pages or Posts is not being retrieved.

The canonical can be found in the advanced tab of the Yoast section for the page and post.

WooCommerce - Product Pages Support

Hello Guys,

I'm building an ecom site and using this plugin to retrieve Yoast SEO configuration.

Although I get all the SEO information for Pages/Posts and even ProductCategories, Products in specific retrieve no information at all.

metaDesc returning same content for all posts

When a number of posts is queried, the metaDesc content is taken from the first post and applied to all in that list.

This can be replicated in the GraphiQL editor - no changes made to theme.

opengraphImage and twitterImage not showing in API

Hi,

I have a page with both, the opengraph image and twitter image set, but both fields, opengraphImage and twitterImage show up as null in the API.

I have looked at the code and found the following problems: The value for YoastSEO()->meta->for_post($post->ID)->open_graph_images, which is used to retrieve the value for the open graph image, returns the images as an array or arrays. From the first image in the array, the url is taken and then put through wp's attachment_url_to_postid function to retrieve the id. Unfortunately, the URL in the array is a scaled Version of the original image, meaning that it has the dimensions of the thumbnail attached to the original filename (eg. my-image-1640x680.jpg). The attachment_url_to_postid function can't find the media attachment with this URL and returns 0, resulting in a null value for the API.

A similar problem exists for the twitter image, where the YoastSEO()->meta->for_post($post->ID)->twitter_image call returns a scaled version of the image, resulting in a return value of 0 from the attachment_url_to_postid function.

The problem with opengraphImage could possibly be overcome by using one of the other values in the image array. In my example, the array contains an id field, which could be used directly. However, I'm unsure if this value is always available.

I would also like to ask, wether it is necessary to return the images as MediaItems instead of as simple URLs. Yoast returns the scaled versions of the images, since they are optimized for the specific use-case. By expanding them back to MediaItems, the implementation that uses the information needs to re-decide which size to use.

I can offer to implement the changes if you like, but wanted to discuss the topic before creating a pull request.

Thank you for a great plugin!

PHP Notice: Undefined index

Hi..

In my debug.log on my Wordpress installation, I get these notices when Gatsby tries to build..
I'm converting to Gatsby v3 with gatsby-source-wordpress, but so far no success.. I don't know if these are the cause my builds fail, but it's worth mentioning.

[19-Mar-2021 01:15:48 UTC] PHP Notice:  Undefined index: title-mediaItem in /subdomains/admin/wp-content/plugins/add-wpgraphql-seo/wp-graphql-yoast-seo.php on line 165
[19-Mar-2021 01:15:48 UTC] PHP Notice:  Undefined index: metadesc-mediaItem in /subdomains/admin/wp-content/plugins/add-wpgraphql-seo/wp-graphql-yoast-seo.php on line 166
[19-Mar-2021 01:15:48 UTC] PHP Notice:  Undefined index: noindex-mediaItem in /subdomains/admin/wp-content/plugins/add-wpgraphql-seo/wp-graphql-yoast-seo.php on line 167
[19-Mar-2021 01:15:48 UTC] PHP Notice:  Undefined index: schema-page-type-mediaItem in /subdomains/admin/wp-content/plugins/add-wpgraphql-seo/wp-graphql-yoast-seo.php on line 168
[19-Mar-2021 01:15:48 UTC] PHP Notice:  Undefined index: title-actionMonitorAction in /subdomains/admin/wp-content/plugins/add-wpgraphql-seo/wp-graphql-yoast-seo.php on line 165
[19-Mar-2021 01:15:48 UTC] PHP Notice:  Undefined index: metadesc-actionMonitorAction in /subdomains/admin/wp-content/plugins/add-wpgraphql-seo/wp-graphql-yoast-seo.php on line 166
[19-Mar-2021 01:15:48 UTC] PHP Notice:  Undefined index: noindex-actionMonitorAction in /subdomains/admin/wp-content/plugins/add-wpgraphql-seo/wp-graphql-yoast-seo.php on line 167
[19-Mar-2021 01:15:48 UTC] PHP Notice:  Undefined index: schema-page-type-actionMonitorAction in /subdomains/admin/wp-content/plugins/add-wpgraphql-seo/wp-graphql-yoast-seo.php on line 168
[19-Mar-2021 01:15:48 UTC] PHP Notice:  Trying to get property 'user_nicename' of non-object in /subdomains/admin/wp-content/plugins/add-wpgraphql-seo/wp-graphql-yoast-seo.php on line 612

Wordpress error when running gatsby develop

Hey,

I got the following error in Wordpress when I ran gatsby develop locally, with wp-graphql-yoast-seo, WP GraphQL, and WP Gatsby installed, as well as WPML (posts in various languages):

PHP Recoverable fatal error: Object of class WPGraphQL\Model\Post could not be converted to string in /.../wp-content/plugins/wordpress-seo/frontend/class-frontend.php on line 563

I could fix this error by editing line 75 of your plugin (adding "->post_title"):
'title' => trim($wpseo_frontend->title($post->post_title)),

Cannot query field \"seo\" on type \"Post\

query GetPosts {
  posts {
    nodes {
      id
      title
      seo {
        canonical
        title
        metaDesc
        focuskw
        metaRobotsNoindex
        metaRobotsNofollow
        opengraphAuthor
        opengraphDescription
        opengraphTitle
        opengraphDescription
        opengraphImage {
          altText
          sourceUrl
          srcSet
        }
        opengraphUrl
        opengraphSiteName
        opengraphPublishedTime
        opengraphModifiedTime
      }
      date
      content
      featuredImage {
        node {
          id
          link
        }
      }
    }
  }
}

Results in

{
  "errors": [
    {
      "message": "Cannot query field \"seo\" on type \"Post\".",
      "extensions": {
        "category": "graphql"
      },
      "locations": [
        {
          "line": 6,
          "column": 7
        }
      ]
    }
  ],
  "extensions": {
    "debug": [
      {
        "type": "DEBUG_LOGS_INACTIVE",
        "message": "GraphQL Debug logging is not active. To see debug logs, GRAPHQL_DEBUG must be enabled."
      }
    ]
  }
}

2021-04-20_15-04-45

Authors social links

Hi, Yoast adds fields for social media links for the users (twitter, facebook...) Can I use that plugin to fetch them? If not is it hard to do that? I would like to help on creating that if it is not avaliable

Expose googlebot default value

Would it be possible to expose the content of the googlebot field to graphql?

Currently I don't see a way to utilize the data provided to build consistent meta tags across the rendered frontend and an application that consumes the graphql endpoint.

Yoast Content Types - Enhancement

It would be great if this plugin could pull content from the "Content Types" tab under "Search Appearance".

This would mean Post and Custom Post Type archives could have titles/description meta handled from WordPress, rather than having to hard code this in Gatsby.

Is logo/companyLogo working?

Hi, first of all thank you for the hard work!

I have set the company logo in the configuration wizard for my website (and it shows there), but when I query it from the GraphQL IDE, the logo / companyLogo / personLogo is empty.

Do you think it could be a bug or maybe I am doing something wrong?

# VERSIONS
"ashhitch/wp-graphql-yoast-seo": "^4.14",
"wpackagist-plugin/wordpress-seo": "^16.1",

query:

{
  seo {
    schema {
      logo {
        id
        sourceUrl
      }
      companyLogo {
        id
        sourceUrl
      }
      personLogo {
        id
        sourceUrl
      }
    }
  }
}

result:

{
  "data": {
    "seo": {
      "schema": {
        "logo": null,
        "companyLogo": null,
        "personLogo": null
      }
    }
  }
}

Thank you! :)

cardType appears in WP GraphiQL but not in Gatsby GraphiQL

Hi,

I'm trying to get this:

{
  seo {
    social {
      twitter {
        cardType
      }
    }
  }
}

To appear in a Gatsby site running gatsby-source-wordpress-experimental. However, the cardType field is always missing on the Gatsby side.

I can confirm the value appears correctly in WP GraphiQL.
I can also confirm the value appears correctly using GraphQL Playground connected to the WP site.

But in Gatsby, the cardType field is never recognized.

As a side note, I can confirm other general settings can be queried successfully, such as the username field that exists under the same twitter object.

I also mentioned this issue in the gatsby-source-wordpress-experimental repository: gatsbyjs/gatsby-source-wordpress-experimental#111 (comment) (second part of the comment).

Any idea if the issue might be in this WP plugin?

Thanks.

[Bug] - All posts return same title/metaDesc

Steps to repro:

  1. wordpress site with yoast 14.0.3
  2. install wordpress plugin wpgraphql 0.8.4
  3. install wordpress plugin wp-graphql-yoasy-seo 3.3.0
  4. using some graphql editor (eg GraphIQL) execute the following query:
{
  posts(first: 10) {
    edges {
      node {
        id
        title
        seo {
          title
          metaDesc
          focuskw
          metaKeywords
          metaRobotsNoindex
          metaRobotsNofollow
          opengraphTitle
          opengraphDescription
          opengraphImage {
            altText
            sourceUrl
            srcSet
          }
          twitterTitle
          twitterDescription
          twitterImage {
            altText
            sourceUrl
            srcSet
        }
        }
      }
    }
  }
}

expected:
Title and meta description reflect each individual post

actual:
Title and meta description match the most recently generated post

Improve breadcrumbs

Hi, can you add one more field for this:

 seo {     
      breadcrumbs {
        url
        uri   // need this, without domain of wp site
      }
    }

The url will direct to admin page, can you add uri for it ?

Add dynamic meta data

Does this plugin still work with wp-graphql 0.3.2 (after the major 0.3.0 overhaul)? I did a quick test and it seems the graphql queries only return data when you manually edited the meta tags with the plugin. All autogenerated Yoast entries are empty strings

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.