Get GraphQL query for a content type
GET
/api/queries/{repo}/{type}
const url = 'https://example.com/api/queries/example/example';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://example.com/api/queries/example/example \ --header 'Authorization: Bearer <token>'Retrieves the auto-generated GraphQL query string for a specific content type in a repository
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”repo
required
Repository ID
string
type
required
Content type name
string
Responses
Section titled “Responses”GraphQL query retrieved successfully
Media typetext/plain
GraphQL query string for the specified content type
string
Example
query GetArticle($id: ID!) { article(id: $id) { id name slug } }Repository or type not found
Media typeapplication/json
object
error
required
Indicates an error occurred
boolean
message
required
Error message describing what went wrong
string
Example
{ "error": true, "message": "Item not found"}