Expand my Community achievements bar.

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

Avatar

Level 3

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. 

saravanaprakash_2-1703634840565.png

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?

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

3 Replies

Avatar

Community Advisor

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

Avatar

Administrator

@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.



Kautuk Sahni