Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic date SEO query #151

Open
marcusforsberg opened this issue Feb 16, 2023 · 0 comments
Open

Dynamic date SEO query #151

marcusforsberg opened this issue Feb 16, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@marcusforsberg
Copy link

#148 introduced the ability to query date archive settings, which works well.

However, is there any way to add a dynamic query for this where you can specify a specific date? In the Yoast Settings, you can add a "Date" variable which is normally replaced with the actual date. Being able to utilize that variable in GraphQL would be quite powerful.

Consider a date archive setup such as this:

Screen Shot 2023-02-16 at 4 43 56 PM

The query would return:

"seo": {
  "meta": {
    "date": {
      "description": "",
      "title": "Posts from: - my-site"
    }
  }
}

There's no way for the client to know where to inject the date since the "date" variable has been stripped away.

Would it be possible to implement a custom query type such as this (with month and day being optional)?

query GET_DATE_ARCHIVE_SEO {
  dateSeo(year: 2023, month: 2, day: 16) {
    description
        title
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants