Get a Contentful content item

Use the externalItem GraphQL query get a single Contentful content item.

Example request

The first sample code block illustrates a request to retrieve a Contentful content item (entity type is ContentfulContent) based on its identity.

{
  externalItem(
    identity: {
      namespace: "contentful", 
      type: "ContentfulContent", 
      id: "1toEOumnkEksWakieoeC6M_Content_dzb4osfv82yc"
    }) {
    ... on ContentfulContent {
      title
      htmlFragment
      contentFields {
        name
        value
        type
      }
    }
  }
}

Example response

The second code block illustrates the corresponding response with with the requested content item details.

{
  "data": {
    "externalItem": {
      "title": "Hello Contentful",
      "htmlFragment": "\n<p>Hello Contentful</p>\n\n<p>hello-contentful</p>\n\n
<p>Learn how to build your own applications with Contentful.</p>\n\n
<p><a href=\"http://www.google.ro\">This course</a> helps you understand the basics behind Contentful. 
It contains modules that introduce you to core concepts and how your app consumes content from Contentful. 
This content is pulled from Contentful APIs using a Contentful SDK. The user interface of this example app 
is unique to this application and is <em>not</em> a template. This is intentional, and it touches an aspect 
of Contentful's API-first approach that we'll discuss later. The Hello Contentful course covers the following 
topics: - <strong>Contentful's APIs</strong>: Basic components of Contentful - <strong>Content modelling</strong>: 
How content is structured within Contentful - <strong>Authoring content</strong>: Connecting this application to 
Contentful's web app</p>\n\n<p>beginner</p>\n",
      "contentFields": [
        {
          "name": "title",
          "value": "Hello Contentful",
          "type": "RichText"
        },
        {
          "name": "slug",
          "value": "hello-contentful",
          "type": "RichText"
        },
        {
          "name": "shortDescription",
          "value": "Learn how to build your own applications with Contentful.",
          "type": "RichText"
        },
        {
          "name": "description",
          "value": "[This course](http://www.google.ro) helps you understand the basics behind Contentful. 
It contains modules that introduce you to core concepts and how your app consumes content from Contentful. 
This content is pulled from Contentful APIs using a Contentful SDK.\n\nThe user interface of this example app 
is unique to this application and is _not_ a template. This is intentional, and it touches an aspect of 
Contentful's API-first approach that we'll discuss later.\n\nThe Hello Contentful course covers the following 
topics:\n\n- **Contentful's APIs**: Basic components of Contentful\n- **Content modelling**: How content is 
structured within Contentful\n- **Authoring content**: Connecting this application to Contentful's web app",
          "type": "RichText"
        },
        {
          "name": "skillLevel",
          "value": "beginner",
          "type": "RichText"
        }
      ]
    }
  }
}