Content fragment models' Graphql querytypes not working after AEM upgrade to 6.5.15 | Community
Skip to main content
Level 2
April 25, 2023

Content fragment models' Graphql querytypes not working after AEM upgrade to 6.5.15

  • April 25, 2023
  • 3 replies
  • 1777 views

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. 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

3 replies

krati_garg
Adobe Employee
Adobe Employee
April 25, 2023

@wei_lyu 

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?

wei_lyuAuthor
Level 2
April 25, 2023

@krati_garg 

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?

TarunKumar
Community Advisor
Community Advisor
April 25, 2023

Hi @wei_lyu ,
Try to check if anything has changed around: 

1. Content Fragment Models

2. Content Fragments
and how it were in working condition.

Siva_Sogalapalli
Community Advisor
Community Advisor
April 25, 2023

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.  

 

 

 

 

wei_lyuAuthor
Level 2
April 25, 2023

@siva_sogalapalli 

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?