Skip to main content
November 21, 2024
Beantwortet

GraphQL Query only partially encoded

  • November 21, 2024
  • 1 Antwort
  • 593 Ansichten

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

 

Dieses Thema wurde für Antworten geschlossen.
Beste Antwort von 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 Antwort

arunpatidar
Community Advisor
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