> For the complete documentation index, see [llms.txt](https://docs.suggestic.com/graphql/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.suggestic.com/graphql/query/queries/content/content-library.md).

# Content Library

Query content library articles

Use the `contentLibrary`query to retrieve a list of content elements.

### Available Arguments

<table data-header-hidden><thead><tr><th width="304.3333333333333">Field</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><strong>Arguments</strong></td><td><strong>Type</strong></td><td><strong>Description</strong></td></tr><tr><td><code>categories</code></td><td>[ID]</td><td><strong>Optional</strong> filter by category, default to all when not present or empty</td></tr><tr><td><code>enablePersonalizedContent</code></td><td>Boolean</td><td><strong>Optional,</strong> Returns content that matches program rule tags at the top of the list. Prioritized content appears first, but other content is still included.</td></tr><tr><td><code>isRead</code></td><td>Boolean</td><td><strong>Optional</strong> to filter by read status.</td></tr></tbody></table>

### Available Fields

| **ield**     | **Description**        | **Type**                                                                                                                                       |
| ------------ | ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| `categories` | \[ContentCategoryType] | List of [categories](https://app.gitbook.com/o/-LwqSh0rNboNaGEQruZQ/s/-LwqSnBDpAb6mFZYLsuB/~/changes/1886/objects/content/content-categories). |
| `createdAt`  | DateTime               | Content library creation date, format: `YYYY-MM-DDT hh:mm:ssZ`                                                                                 |
| `id`         | ID!                    | Id of content library.                                                                                                                         |
| `imageUrl`   | String                 | Content thumbnail image URL.                                                                                                                   |
| `isBlocked`  | Boolean                | **True** makes the content unavailable to the users, otherwise **False**.                                                                      |
| `isFavorite` | Boolean                | **True** marks the content as favorite, otherwise **False**.                                                                                   |
| `isFeatured` | Boolean                | **True** marks the content as featured, otherwise **False**.                                                                                   |
| `isRead`     | Boolean                | True if the content element has been marked as read or completed.                                                                              |
| `lang`       | JSONString             | Json with content library translated.                                                                                                          |
| `order`      | Int!                   | Used to set category order(The highest value sits on top).                                                                                     |
| `programs`   | \[Program!]            | List of programs the content is available to.                                                                                                  |
| `sourceUrl`  | String                 | Link to the source content.                                                                                                                    |
| `subTitle`   | String                 | Content subtitle.                                                                                                                              |
| `tags`       | \[ContentTagType!]     | List of [tags](https://app.gitbook.com/o/-LwqSh0rNboNaGEQruZQ/s/-LwqSnBDpAb6mFZYLsuB/~/changes/1886/objects/content/content-tag).              |
| `title`      | String                 | Content Title.                                                                                                                                 |
| `updatedAt`  | DateTime               | Content library last update format: `YYYY-MM-DDT hh:mm:ssZ`                                                                                    |

### Example with Category Filter

{% tabs %}
{% tab title="Query" %}

```graphql
{
  contentLibrary(
    categories: ["Q2F0ZWdvcnk6MTBhYjhhN2YtZDk5OC00ZWRjLThhMTItMmViMWJhMDM3NWE4"]
  ) {
    edges {
      node {
        id
        title
        subTitle
        categories {
          id
          name
          image
        }
        tags {
          id
          name
        }
        imageUrl
        sourceUrl
        order
        isFavorite
        isFeatured
        isBlocked
        isRead
      }
    }
  }
}

```

{% endtab %}

{% tab title="Response" %}

```javascript
{
  "data": {
    "contentLibrary": {
      "edges": [
        {
          "id": "Q29udGVudDoyZDJhZjYxOC0xNGJmLTQ1MzAtODlkYS0xNjY4ZTUxMGYzYTg=",
          "title": "Tips for switching to a plant based Diet",
          "subtTitle": null,
          "isBlocked": true,
          "isRead": true,
          "categories": [
            {
              "id": "Q2F0ZWdvcnk6MTBhYjhhN2YtZDk5OC00ZWRjLThhMTItMmViMWJhMDM3NWE4",
              "slug": "lifestyle"
              "name": "Lifestyle"
            }
          ],
          "imageUrl": "https://source.unsplash.com/random/800x600",
          "sourceUrl": "https://webviewcontent.com"
        }
      ]
    }
  }
}
```

{% endtab %}
{% endtabs %}

### Example with Tag and Read Status Filter

{% tabs %}
{% tab title="Query" %}

```graphql
{
 contentLibrary (tags:"something" isRead:true) {
     edges{
         node{
             title
             isRead
             tags{
                 name
                 id
             }
         }
     }
 }
```

{% endtab %}
{% endtabs %}

### Example Obtaining Personalized Content

{% tabs %}
{% tab title="Query" %}

```graphql
 contentLibrary(enablePersonalizedContent: true) {
    edges {
      node {
        id 
        title 
        tags { 
          name 
        }
      }
    }
  }
```

{% endtab %}
{% endtabs %}
