We recently upgraded our AEM on-prem instance from version 6.5.9 to 6.5.15.
However, after the upgrade, we noticed that the Graphql querytypes for our old content fragment models stopped working on Author. We've tried to republish the GraphQL endpoint, disable and re-enable the CFMs, but it's still not working.
When we run a graphql like this
{
"query": "query {movieList {items {_path}}}"
}
, which used to run well on 6.5.9, it gets this error
{
"errors": [
{
"message": "Validation error of type FieldUndefined: Field 'movieList' in type 'QueryType' is undefined @ 'movieList'",
"locations": [
{
"line": 1,
"column": 8
}
],
"extensions": {
"classification": "ValidationError"
}
}
]
}
We checked the GraphQL tab in the CFM's properties and it shows the Multiple Query Field Name is exactly movieList. We also checked that the cfm-graphql-index-def-1.0.5.zip is properly installed. Can anyone help us identify the root cause of this issue and provide a solution? Thank you.
Views
Replies
Total Likes
Can you simply try:
query {
movieList {
items {
_path
}
}
}
And is it an issue, when querying by path like
{
movieByPath(_path: "_cf_path") {
item {
_path
title
}
}
}
Also, is this error isolated to this particular CF Model. Have you tried with Sample CFs?
Thank you for your response. I attempted to use the faqList to query the faq model in we-retail and was successful. As I mentioned in my reply to @Siva_Sogalapalli 's comment, the schema generation in SP15 seems to be generating query types based on CFM titles instead of names, which is unexpected. Would you mind taking a look at this issue as well?
I think you have to update update your graphql queries as well when you upgrade AEM to 6.5.15,
prior to AEM 6.5.15, graphql was querying data based below properties of content fragment model but now it works based on content fragment model name itself.
Thank you for your response. It appears that GraphQL is presently retrieving data based on the CFM's title rather than its name. I created a CFM named "test-model", then I titled it "Test Model Title". When I accessed the GraphiQL editor, only "testModelTitleList" was displayed, not "testModelList".
Is this the intended behavior?
In the event that this behavior is intentional, it has resulted in a subsequent issue. Our team has utilized Japanese characters for the CFM titles and English words for the names. However, this has led to the generation of GraphQL types such as "__List_2" for a CFM with the title "動画" (the name is "movie"). My guess is that the GraphQL system within SP15 does not function optimally with non-alphabet characters. Unfortunately, using a term like "__List_2" in our queries would be unclear to other developers. As such, do you have any suggestions for a possible solution or workaround?