<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>7.2.1 - GraphQL returning invalid URL for accessing content?</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=118100733" />
  <subtitle>7.2.1 - GraphQL returning invalid URL for accessing content?</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=118100733</id>
  <updated>2026-04-05T14:41:18Z</updated>
  <dc:date>2026-04-05T14:41:18Z</dc:date>
  <entry>
    <title>RE: 7.2.1 - GraphQL returning invalid URL for accessing content?</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118117753" />
    <author>
      <name>Javier Gamarra</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118117753</id>
    <updated>2019-12-18T15:32:16Z</updated>
    <published>2019-12-18T15:32:16Z</published>
    <summary type="html">Yes, the idea in the future is to move away from ids (that typically only appear in the database) into keys and external reference codes and show those in the UI.</summary>
    <dc:creator>Javier Gamarra</dc:creator>
    <dc:date>2019-12-18T15:32:16Z</dc:date>
  </entry>
  <entry>
    <title>RE: 7.2.1 - GraphQL returning invalid URL for accessing content?</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118116765" />
    <author>
      <name>Jack Bakker</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118116765</id>
    <updated>2019-12-18T14:58:08Z</updated>
    <published>2019-12-18T14:58:08Z</published>
    <summary type="html">I am leaning to using keys wherever I can, so that I can avoid looking in the database. </summary>
    <dc:creator>Jack Bakker</dc:creator>
    <dc:date>2019-12-18T14:58:08Z</dc:date>
  </entry>
  <entry>
    <title>RE: 7.2.1 - GraphQL returning invalid URL for accessing content?</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118114429" />
    <author>
      <name>Fernando Fernandez</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118114429</id>
    <updated>2019-12-18T14:24:32Z</updated>
    <published>2019-12-18T14:24:32Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;Thanks Jack! Your suggested query also works:&lt;br&gt;&lt;pre&gt;&lt;code&gt;query{
&amp;amp;nbsp; structuredContentByKey( key: "35506", siteKey: "Guest" ){
&amp;amp;nbsp; &amp;amp;nbsp; renderedContentTemplate(templateId: 35566)
&amp;amp;nbsp; }
}
&lt;/code&gt;&lt;/pre&gt;&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Fernando Fernandez</dc:creator>
    <dc:date>2019-12-18T14:24:32Z</dc:date>
  </entry>
  <entry>
    <title>RE: 7.2.1 - GraphQL returning invalid URL for accessing content?</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118110573" />
    <author>
      <name>Jack Bakker</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118110573</id>
    <updated>2019-12-18T12:08:14Z</updated>
    <published>2019-12-18T12:08:14Z</published>
    <summary type="html">Hi Fernando, you could try:&lt;br /&gt;query{&lt;br /&gt;  structuredContentByKey(key: &amp;#34;35506&amp;#34;,siteKey: &amp;#34;yourSiteKey&amp;#34;){&lt;br /&gt;    renderedContentTemplate(templateId: 35566)&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;yourSiteKey would be same as group_.groupkey in db (which I think is always? the same as the site name)</summary>
    <dc:creator>Jack Bakker</dc:creator>
    <dc:date>2019-12-18T12:08:14Z</dc:date>
  </entry>
  <entry>
    <title>RE: 7.2.1 - GraphQL returning invalid URL for accessing content?</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118112785" />
    <author>
      <name>Fernando Fernandez</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118112785</id>
    <updated>2019-12-18T08:39:55Z</updated>
    <published>2019-12-18T08:39:55Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;Thanks Javier, it works! :-)&lt;br&gt;The final query is:&lt;br&gt;&lt;pre&gt;&lt;code&gt;query{
&amp;amp;nbsp; structuredContentRenderedContentTemplate(structuredContentId: 35508 , templateId: 35566 )
}
&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;Oddly, this query expects the article primary key instead of the articleId used in the other query. Any idea why?&lt;br&gt;Thanks&lt;br&gt;Fernando&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Fernando Fernandez</dc:creator>
    <dc:date>2019-12-18T08:39:55Z</dc:date>
  </entry>
  <entry>
    <title>RE: 7.2.1 - GraphQL returning invalid URL for accessing content?</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118111180" />
    <author>
      <name>Javier Gamarra</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118111180</id>
    <updated>2019-12-17T22:05:56Z</updated>
    <published>2019-12-17T22:05:56Z</published>
    <summary type="html">As a temporal workaround, if you know the templateId, you can use renderedContentTemplate(templateId: X) </summary>
    <dc:creator>Javier Gamarra</dc:creator>
    <dc:date>2019-12-17T22:05:56Z</dc:date>
  </entry>
  <entry>
    <title>RE: 7.2.1 - GraphQL returning invalid URL for accessing content?</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118108842" />
    <author>
      <name>Javier Gamarra</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118108842</id>
    <updated>2019-12-17T22:00:45Z</updated>
    <published>2019-12-17T22:00:45Z</published>
    <summary type="html">Good catch, that&amp;#39;s a bug. I&amp;#39;ve created this ticket to track it: &lt;a href="https://issues.liferay.com/browse/LPS-105982"&gt;https://issues.liferay.com/browse/LPS-105982&lt;/a&gt; Thanks!</summary>
    <dc:creator>Javier Gamarra</dc:creator>
    <dc:date>2019-12-17T22:00:45Z</dc:date>
  </entry>
  <entry>
    <title>RE: 7.2.1 - GraphQL returning invalid URL for accessing content?</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118107978" />
    <author>
      <name>Fernando Fernandez</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118107978</id>
    <updated>2019-12-17T17:51:03Z</updated>
    <published>2019-12-17T17:51:03Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;Meanwhile, if the OpenAPI service is used, it works:&lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;http://localhost:8080/o/headless-delivery/v1.0/structured-contents/35508/rendered-content/35566&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;&lt;a href="http://localhost:8080/o/headless-delivery/v1.0/structured-contents/35508/rendered-content/35566"&gt;&lt;/a&gt;The rendered content is returned, formatted by the correct template.&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Fernando Fernandez</dc:creator>
    <dc:date>2019-12-17T17:51:03Z</dc:date>
  </entry>
  <entry>
    <title>7.2.1 - GraphQL returning invalid URL for accessing content?</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118100732" />
    <author>
      <name>Fernando Fernandez</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118100732</id>
    <updated>2019-12-17T10:42:25Z</updated>
    <published>2019-12-17T10:42:25Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;Hi all,&lt;br&gt;I'm exploring GraphQL in 7.2 GA2, using Altair as a chrome extension.&amp;nbsp;&lt;br&gt;I'm currently able to find a content with this query:&lt;br&gt;&lt;pre&gt;&lt;code&gt;query{
&amp;amp;nbsp; structuredContentByKey(key: "35506", siteId: 20124){
&amp;amp;nbsp;&amp;amp;nbsp; &amp;amp;nbsp;friendlyUrlPath
&amp;amp;nbsp;   title
&amp;amp;nbsp;   renderedContents{
&amp;amp;nbsp; &amp;amp;nbsp;   renderedContentURL
&amp;amp;nbsp; &amp;amp;nbsp;   templateName
&amp;amp;nbsp;   }
&amp;amp;nbsp; }
}&lt;/code&gt;&lt;/pre&gt;The query result is:&lt;br&gt;&lt;pre&gt;&lt;code&gt;{
&amp;amp;nbsp; "data": {
&amp;amp;nbsp; &amp;amp;nbsp; "structuredContentByKey": {
&amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; "friendlyUrlPath": "directions-generic",
&amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; "title": "Directions - generic",
&amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; "renderedContents": [
&amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; {
&amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; "renderedContentURL": "http://localhost:8080/o/graphql/v1.0/structured-contents/35508/rendered-content/28105",
&amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; "templateName": "Basic Web Content"
&amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; },
&amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; {
&amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; "renderedContentURL": "http://localhost:8080/o/graphql/v1.0/structured-contents/35508/rendered-content/35566",
&amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; "templateName": "Alternative BWC template"
&amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; }
&amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; ]
&amp;amp;nbsp; &amp;amp;nbsp; }
&amp;amp;nbsp; }
}
&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;But the URL provided by the query is failing with a 400 status and the following message is appearing on the log:&lt;br&gt;&lt;pre&gt;&lt;code&gt;[AbstractGraphQLHttpServlet:141] Bad GET request: path was not "/schema.json" or no query variable named "query" given

&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;Is this a bug or am I doing something wrong?&lt;br&gt;TIA&lt;br&gt;Fernando&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Fernando Fernandez</dc:creator>
    <dc:date>2019-12-17T10:42:25Z</dc:date>
  </entry>
</feed>
