Persist query for nodeByUri
-
Hello there,
I installed WPGraphQL samrt cache plugin and using it’s persist query cache. I saved on uqery in graphQL documents. Here is my query:
query getCategory($id: ID = "/article/test-article") {
category(id: $id, idType: URI) {
id
uri
description
name
termTaxonomyId
}
}This generates alias and I can use that query id with get request and it works fine.
Here, I have question is if I have 1000 categories and I want get category data with get request by creating query with variables is it possible. I want something like below with with graphQl documents:
query getCategory($id: ID = "") {
category(id: $id, idType: URI) {
id
uri
description
name
termTaxonomyId
}
}
variables: "{"id": "/article/test-article"}"Here, “id” will be URI of the article user visit on front-end. So this can be achieve with graphQL documents for dynamic variables?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- You must be logged in to reply to this topic.