Expand my Community achievements bar.

Join us in celebrating the outstanding achievement of our AEM Community Member of the Year!
SOLVED

GraphQL Query only partially encoded

Avatar

Level 1

Hi all,

I'm having a weird issue when trying GraphQL query in my AEM application. In my query I want to filter with the brand which is a tag field. The URL according to AEM documentation need to be encoded:

But when I encoded the url like this, it just return no item.

localhost:4502/graphql/execute.json/contentfragment/get-central-content-list%3Busecase%3Dmyhighlights%3Bbrand%3Dauto%3Acaas%2Fmetadata%2Fbrand%2Fbmw 

 

When I only remove the encoding from the brand filter, then it works: 

 

localhost:4502/graphql/execute.json/contentfragment/get-central-content-list%3Busecase%3Dmyhighlights%3Bbrand%3Dauto:caas/metadata/brand/bmw

 

I wonder why graphQl behaves like that, should the parameter value not be encoded? I'm using AEM 6.5

Thank you

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @vietdzungdang 


Probably java.net.URLEncoder is used for encoding 
This encoding is commonly used in web addresses (URLs) to safely include special characters like spaces, punctuation, or symbols that might conflict with the URL structure.



Arun Patidar

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

Hi @vietdzungdang 


Probably java.net.URLEncoder is used for encoding 
This encoding is commonly used in web addresses (URLs) to safely include special characters like spaces, punctuation, or symbols that might conflict with the URL structure.



Arun Patidar