wp-graphql-yoast-seo
wp-graphql-yoast-seo copied to clipboard
Dynamic date SEO query
#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:
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
}
}