Graphql Query: Unable to display posts ,after modifying any category/ subcategory in wordpress – WPGRAPHQL Plugin
In one of our websites we are using WPGRAPHQL (https://www.wpgraphql.com/) plugin to fetch posts and display them in the third party site. In normal cases, this is working fine. While modifying any category/ subcategory in the parent website, the posts under the modified category/ subcategory are not getting using Graphql query. These posts are available in the graphql responses, only if we delete that particular category/ subcategory and re-create it.
The query we are using is:
{
posts(where: {categoryId: 954}, first: 1000) {
nodes {
id
title
date
dateGmt
status
uri
link
modified
modifiedGmt
featuredImage {
node {
fileSize
uri
sourceUrl
mimeType
mediaType
id
altText
date
dateGmt
modified
modifiedGmt
mediaItemUrl
}
}
author {
node {
name
description
email
lastName
firstName
id
avatar(size: 600) {
url
width
height
}
}
}
categories {
nodes {
name
}
}
tags {
nodes {
id
name
}
}
seo {
canonical
title
metaDesc
metaKeywords
opengraphTitle
opengraphUrl
opengraphSiteName
opengraphPublishedTime
opengraphModifiedTime
opengraphDescription
opengraphAuthor
opengraphImage {
altText
sourceUrl
srcSet
}
twitterTitle
twitterDescription
twitterImage {
altText
sourceUrl
srcSet
}
}
}
}
}
In one of our websites we are using WPGRAPHQL (https://www.wpgraphql.com/) plugin to fetch posts and display them in the third party site. In normal cases, this is working fine. While modifying any category/ subcategory in the parent website, the posts under the modified category/ subcategory are not getting using Graphql query. These posts are available in the graphql responses, only if we delete that particular category/ subcategory and re-create it.
The query we are using is:
{
posts(where: {categoryId: 954}, first: 1000) {
nodes {
id
title
date
dateGmt
status
uri
link
modified
modifiedGmt
featuredImage {
node {
fileSize
uri
sourceUrl
mimeType
mediaType
id
altText
date
dateGmt
modified
modifiedGmt
mediaItemUrl
}
}
author {
node {
name
description
email
lastName
firstName
id
avatar(size: 600) {
url
width
height
}
}
}
categories {
nodes {
name
}
}
tags {
nodes {
id
name
}
}
seo {
canonical
title
metaDesc
metaKeywords
opengraphTitle
opengraphUrl
opengraphSiteName
opengraphPublishedTime
opengraphModifiedTime
opengraphDescription
opengraphAuthor
opengraphImage {
altText
sourceUrl
srcSet
}
twitterTitle
twitterDescription
twitterImage {
altText
sourceUrl
srcSet
}
}
}
}
}
Any solution for this issue is much appreciated. Thanking you in advance.
Leave an answer