GraphQL Support In Headless?

#297935
  • Resolved Steve Brown
    Rank Math free

    Hi there,
    I was previously a user of Rank Math and looking at going Pro, but I had to switch to Yoast because I use Gatsby and WPGraphQL, which is supported by Yoast.

    I note with extreme interest that you now provide a REST API endpoint for Rank Math. Are there any plans to incorporate WPGraphQL fields too?

    If there are, may I also make a small suggestion, based on my experience with Yoast. When exposing data in WPGraphQL (and probably the REST API too) it’s important to understand that often, headless users will have the WordPress installation on a very different subdomain to the generated HTML. For example, I host my WordPress backend on [moved to sensitive data section]

    With that in mind, it’s an important feature (to me at least, and I suspect other headless users) to have the ability to ‘rewrite’ the exposed URLs. It’s also important to note, that in Gatsby Source WordPress, any URLs that match the GraphQL endpoint will be rewritten to local notation (ie, the scheme and host is stripped). This can cause big problems with GraphQL generated headers such as breadcrumbs and other Schema.org data that Google expects to see a full URL (as well as twitter:image OG tags).

    Anyway, I’ve rambled enough. I’d absolutely love to switch back to Rank Math and WPGraphQL would see that be possible for me. And I’ll write an article about how great it is 🙂

    If you need a tester, I’m more than happy to help and will volunteer time to help you make it work well with Gatsby as I have done exactly this on my sites but as I say, forced to use Yoast at the moment.

    Many thanks for your time,

Viewing 2 replies - 1 through 2 (of 2 total)
  • Meh – didn’t realise this would be a public forum post – didn’t really want to expose my Admin URL… Not a huge problem it’s only accessible by LAN but that’s not the point.

    Hello,

    Thank you for your suggestions.

    Our REST API endpoint can be used on headless WP setups to generate the HTML tags that go in the <head> part of a page with a given URL.

    We do have plans to add support for WPGraphQL, too – either as part of Rank Math, or as an extension for the plugin. Unfortunately, I can’t give an ETA for this feature yet.

    We will definitely consider your suggestion about the “rewritable” URLs. Although, I’d like to point out that it is already possible to rewrite all the URLs that appear in the code block generated by Rank Math, using our filter hooks.

    Thanks again, and if you have any other suggestions related to this feature, or other parts of our plugin, please let us know.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 2 replies - 1 through 2 (of 2 total)

The ticket ‘GraphQL Support In Headless?’ is closed to new replies.