GraphQL Query only partially encoded | Community
Skip to main content
November 21, 2024
Solved

GraphQL Query only partially encoded

  • November 21, 2024
  • 1 reply
  • 574 views

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

 

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

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.

1 reply

arunpatidar
Community Advisor
arunpatidarCommunity AdvisorAccepted solution
Community Advisor
November 21, 2024

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