Skip to main content

List Tags

Fetch a paginated list of tags with optional search.
query GetTags($search: String, $page: Int, $limit: Int) {
  tags(search: $search, page: $page, limit: $limit) {
    data {
      id
      name
      slug
      description
    }
    pagination {
      page
      limit
      total
      pages
    }
  }
}

Parameters

ParameterTypeDefaultDescription
searchString-Filter by name
pageInt1Page number
limitInt20Items per page

Example

query {
  tags(search: "tutorial", page: 1, limit: 20) {
    data {
      id
      name
      slug
      description
    }
    pagination {
      total
    }
  }
}
Response:
{
  "data": {
    "tags": {
      "data": [
        {
          "id": "tag123",
          "name": "Tutorial",
          "slug": "tutorial",
          "description": "Educational content and guides"
        },
        {
          "id": "tag124",
          "name": "Advanced Tutorial",
          "slug": "advanced-tutorial",
          "description": "In-depth technical tutorials"
        }
      ],
      "pagination": {
        "total": 2
      }
    }
  }
}

Get Single Tag

Fetch a specific tag by ID.
query GetTag($id: ID!) {
  tag(id: $id) {
    id
    name
    slug
    description
  }
}

Parameters

ParameterTypeRequiredDescription
idID!YesTag ID

Example

query {
  tag(id: "tag123") {
    id
    name
    slug
    description
  }
}
Response:
{
  "data": {
    "tag": {
      "id": "tag123",
      "name": "Tutorial",
      "slug": "tutorial",
      "description": "Educational content and guides"
    }
  }
}

Tag Fields

FieldTypeDescription
idID!Unique identifier
nameString!Tag display name
slugString!URL-safe identifier
descriptionStringTag description

Using Tags in Queries

Tags can be used to filter content and assets:
# Filter content by tags
query {
  contents(tags: ["tutorial", "beginner"]) {
    data {
      id
      name
      tags
    }
  }
}

# Filter assets by tags
query {
  assets(tags: ["hero"]) {
    data {
      id
      name
      url
      tags
    }
  }
}
When filtering by multiple tags, the query uses AND logic. Only items with all specified tags are returned.