I am using Gatsby to deliver a front end to WordPress and querying data with GraphQL.
I have a post with a Custom Post Type and a Custom Taxonomy.
However when I query on the CPT, I can get the number of the Custom Taxonomy but no don't know how to retrieve the corresponding names.
Below is my query;
{
wordpressWpPortfolio {
title
slug
id
portfolio_categories
}
}
And this is what is returned;
{
"data": {
"wordpressWpPortfolio": {
"title": "Test Portfolio 1",
"slug": "test-portfolio-1",
"id": "5caf7182-c9f5-53d9-94da-b49cfbdc6d7f",
"portfolio_categories": [
5
]
}
}
}
However, there are no other fields I can select in the GraphQL playground.
Below is my expected result;
{
"data": {
"wordpressWpPortfolio": {
"title": "Test Portfolio 1",
"slug": "test-portfolio-1",
"id": "5caf7182-c9f5-53d9-94da-b49cfbdc6d7f",
"portfolio_categories": [
"id":5,
"name":"portfolio category name"
]
}
}
}
Is there any way to "join" the rest end points?
What am I doing wrong and how can I fix It?