AEM 6.5.17 | Graphql - Persisted query not working in dispatcher | Community
Skip to main content
Level 2
October 27, 2023
Solved

AEM 6.5.17 | Graphql - Persisted query not working in dispatcher

  • October 27, 2023
  • 3 replies
  • 1774 views

Hi All,

 

In the author and publish instances the persisted queries working fine. but on the dispatcher, it is not working.

 

 

I have added the below rules in the rewrite and dispatcher.any files


in rewrite file

 

RewriteCond %{REQUEST_URI} ^/graphql/execute.json RewriteRule ^/(.*)$ /$1;.json [PT]

 


in dispatcher.any

 

/0060 { /type "allow" /method '(POST|OPTIONS)' /url "/content/_cq_graphql/*/endpoint.json" }/0061 { /type "allow" /method '(GET|POST|OPTIONS)' /url "/graphql/execute.json*" }

 

 

Thanks,

RadhaKrishna

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 n_radhakrishna

Hi All,

 

The request was going to a different dispatcher and publish instance and I was working on another setup. We added above mentioned rewrite rules and dispatcher rules in our server setup and started working.

 

Thank you all.

3 replies

aanchal-sikka
Community Advisor
Community Advisor
October 27, 2023

Hello @n_radhakrishna 

 

Can you please try following?

 

Filter

/0502 { /type "allow" /extension "json" /path "/graphql/execute" /method "GET" }

 

Rewrite

RewriteCond %{REQUEST_URI} ^/graphql/execute.json RewriteRule ^/(.*)$ /$1;.json [PT]

Also, please elaborate what you mean by not working?

Aanchal Sikka
Level 2
October 27, 2023

Hi Anchal,

 

In the publish instance when I access the persisted query, I see JSON response and getting persistence error in the dispatcher, and in the network tab status is 404.

 

screenshot - dispatcher  status 404

 

screenshot - publish instance  status 200

 

aanchal-sikka
Community Advisor
Community Advisor
October 27, 2023

@n_radhakrishna 

 

Are you executing the query on publish as anonymous user? I mean without a session?

Aanchal Sikka
Mahedi_Sabuj
Community Advisor
Community Advisor
October 27, 2023

Hi @n_radhakrishna, It seems like the request is being blocked by filters. To identify which filter rules are causing this, I suggest reviewing the dispatcher.log where you should be able to pinpoint the specific filter rules responsible for blocking the request.

Mahedi Sabuj
n_radhakrishnaAuthorAccepted solution
Level 2
November 1, 2023

Hi All,

 

The request was going to a different dispatcher and publish instance and I was working on another setup. We added above mentioned rewrite rules and dispatcher rules in our server setup and started working.

 

Thank you all.