One of my persistent queries recently stopped working in the lower environment(Dev) while it is still working in the higher(Production) environment. The content fragment model name is content-json and the title is Content JSON. The QueryType not recognized now is contentJSONByPath which was working fine earlier in Development environment and still working fine in the production environment. The error message shows as Validation error of type FieldUndefined: Field 'contentJSONByPath' in type 'QueryType' is undefined @ 'contentJSONByPath'".
Persistent query throwing error:
query contentJSONByPath($path:String!)
{
contentJSONByPath(_path: $path)
{__typename,
item{__typename
content
}
}
}
While debugging the issue it seems the query type is changed to contentJsonByPath while still showing contentJSONByPath in Content Fragment Model GraphQL Tab's Single Query Field Name. I also found that the Apache Jackrabbit Oak version is changed to 1.22.14 in the Development environment whereas, in the Production environment, it is 1.22.11. Rest everything like AEM version etc looking same.
Wondering if someone faced this issue and know how to fix it? Thanks in advance.
Solved! Go to Solution.
Views
Replies
Total Likes
Finally, we're able to fix the issue by updating the OSGi bundle affected because of the latest service pack 6.5.16 install and then rolled back.
It looks like the issue clearly is the mismatch name between your content fragment model (CFM) and the one used in your persistent query, did you check that the CFM title and name in your dev environment is contentJSONByPath?
Another thing is to give it a try locally, you can spin up a new AEM 6.5.16 which ships Apache Jackrabbit Oak 1.22.14, and there deploy your code, or at least create the content model with the name which is causing the issue to check its behavior.
If you are able to reproduce consistently the behavior with OAK 1.22.14, I think you should submit a support ticket to understand why the query type is not respecting the content fragment model's name. (Maybe JSON is a reserved word in query types or something, sorry I don't know that on top of my head).
To workaround this issue you could rename your CFM to something else that would be new in all the environments and update your persistent query to match the new name. (I guess this is the only CFM that is issued by its name)
Thanks, @EstebanBustamante. The issue is not only with the persistent query but also with post query where AEM is not understanding the old QueryType name showing inside the GraphQL Tab. I know, the team has tried to upgrade the Dev environment in the long past and then rolled it back. Wondering how it propagated now before 1 week and how can we fix it.
Finally, we're able to fix the issue by updating the OSGi bundle affected because of the latest service pack 6.5.16 install and then rolled back.
Views
Likes
Replies