Skip to main content
Level 2
Dec 26, 2023 11:57 PM UTC

AEM GraphQL failing on properties with custom namespaces. How to query properties with custom namespaces?

For our project, we created a new namespace `salsify:` under Content Fragment. For example,

salsify:size salsify:class salsify:color

When creating PersistedQuery, the GraphiQL editor converts colon (:) to underscore and the queries are failing. 

For example, above, property names are actually `salsify:size`, `salsify:class`, `salsify:color`. But graphql editor converts colon to underscores. Now when filtering for input parameters, the query always returns empty items. 

I tried CONTAINS, EQUALS, doesn't work. 

 

We cant query properties with namespace using graphQL?

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

3 replies

TarunKumar
Community Advisor
Community Advisor
Feb 2, 2024 2:18 PM UTC

HI @saravana_sgws ,

graphQL schema naming convention allows only camelCase, PascalCase or SCREAMING_SNAKE_CASE fields. Colons are not allowed in graphql fields.
AEM replace any special characters to underscores. So salsify:size becomes salsify_size for the AEM schema.

Solution:-
Try to append _ignoreCode:true to the filter. This is not required for normal properties but only for name space

Thanks
Tarun

Translate
Kamal_Kishor
Community Advisor
Community Advisor
Feb 5, 2024 10:17 AM UTC
kautuk_sahni
Level 9
Feb 6, 2024 6:38 AM UTC

@saravana_sgws Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.

Translate
Kautuk Sahni