Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

Not able to copy Graphql URL Getting error

Avatar

Level 2

I have created a persisted Graphql query to access headless data and every thing is done I save the Query in Graphql 
and during copy URL click I am getting this error popup 

                       "The Clipboard API is not available"

 

as shown below please help me in getting the url of the Graphql query 

 

pavan4_0-1685533504623.png

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

For posterity, I found the reason and the fix for this behavior

Reason: The clipboard functionality is disabled due to security reasons, the site is not accessing through HTTPS protocol

EstebanBustamante_0-1705503105029.png

Temp Fix: Allow your site to be treated as "secure" by Google Chrome. Follow this article: https://bobbyhadz.com/blog/navigator-clipboard-is-undefined-in-javascript 

EstebanBustamante_1-1705503183585.png

 

Real Fix: Make sure you use your site under HTTPS protocol, which is true in any non-dev environment. 

 

 

Hope this helps.

 

cc: @kautuk_sahni kindly, you can mark this answer and resolve the question



Esteban Bustamante

View solution in original post

6 Replies

Avatar

Employee Advisor

Hi @pavan4 ,

 

On which browser are you facing this issue ?
Can you check performing steps on a different browser and check if you see the same behavior ?

 

Regards,

Milind 

Avatar

Employee Advisor

@pavan4 Please validate that you are using the correct version for aem-sdk-api jar. If not, kindly update and rebuild.
https://experienceleague.adobe.com/docs/experience-manager-cloud-service/content/implementing/develo...

Avatar

Community Advisor

Hello @pavan4 

 

Very silly thing, I am suggesting 
Can you try removing spaces from query name or use - in name to remove space and save and try to copy URL?

 

Don't know if this works!

Avatar

Community Advisor

@pavan4 do you find a solution for this? I seeing the same behavior on my end



Esteban Bustamante

Avatar

Correct answer by
Community Advisor

For posterity, I found the reason and the fix for this behavior

Reason: The clipboard functionality is disabled due to security reasons, the site is not accessing through HTTPS protocol

EstebanBustamante_0-1705503105029.png

Temp Fix: Allow your site to be treated as "secure" by Google Chrome. Follow this article: https://bobbyhadz.com/blog/navigator-clipboard-is-undefined-in-javascript 

EstebanBustamante_1-1705503183585.png

 

Real Fix: Make sure you use your site under HTTPS protocol, which is true in any non-dev environment. 

 

 

Hope this helps.

 

cc: @kautuk_sahni kindly, you can mark this answer and resolve the question



Esteban Bustamante