Skip to main content

List Components

Fetch a paginated list of components with optional search.
query GetComponents($search: String, $page: Int, $limit: Int) {
  components(search: $search, page: $page, limit: $limit) {
    data {
      id
      name
      title
      description
      compiled
      schema
    }
    pagination {
      page
      limit
      total
      pages
    }
  }
}

Parameters

ParameterTypeDefaultDescription
searchString-Filter by name or title
pageInt1Page number
limitInt20Items per page

Example

query {
  components(search: "Product", page: 1, limit: 10) {
    data {
      id
      name
      title
      description
    }
    pagination {
      total
      pages
    }
  }
}
Response:
{
  "data": {
    "components": {
      "data": [
        {
          "id": "comp123",
          "name": "ProductCard",
          "title": "Product Card",
          "description": "Displays product information"
        },
        {
          "id": "comp124",
          "name": "ProductDetail",
          "title": "Product Detail",
          "description": "Full product detail view"
        }
      ],
      "pagination": {
        "total": 2,
        "pages": 1
      }
    }
  }
}

Get Single Component

Fetch a specific component by ID.
query GetComponent($id: ID!) {
  component(id: $id) {
    id
    name
    title
    description
    content
    compiled
    schema
    createdAt
    updatedAt
  }
}

Parameters

ParameterTypeRequiredDescription
idID!YesComponent ID

Example

query {
  component(id: "comp123") {
    id
    name
    title
    compiled
    schema
  }
}
Response:
{
  "data": {
    "component": {
      "id": "comp123",
      "name": "ProductCard",
      "title": "Product Card",
      "compiled": "const body = (props) => { ... }",
      "schema": "{\"type\":\"object\",\"properties\":{...}}"
    }
  }
}

Component Fields

FieldTypeDescription
idID!Unique identifier
nameString!Component name (used in code)
titleStringDisplay title
descriptionStringComponent description
contentStringSource code
compiledStringCompiled JavaScript
schemaStringJSON Schema for props
createdAtDateTime!Creation timestamp
updatedAtDateTime!Last update timestamp