Skip to main content
Retrieves a paginated list of customers with optional filtering and sorting.

Query

query ListCustomers(
  $filter: CustomerFilter
  $paging: CursorPaging
  $sorting: [CustomerSort!]
) {
  customers(filter: $filter, paging: $paging, sorting: $sorting) {
    edges {
      node {
        customerId
        name
        email
        hasActiveSubscription
        createdAt
        subscriptions {
          subscriptionId
          status
          plan {
            refId
          }
        }
      }
      cursor
    }
    pageInfo {
      hasNextPage
      hasPreviousPage
      startCursor
      endCursor
    }
    totalCount
  }
}
{
  "filter": {
    "hasActiveSubscription": { "is": true }
  },
  "paging": {
    "first": 20
  },
  "sorting": [
    { "field": "createdAt", "direction": "DESC" }
  ]
}
{
  "data": {
    "customers": {
      "edges": [
        {
          "node": {
            "customerId": "customer-123",
            "name": "Acme Corp",
            "email": "billing@acme.com",
            "hasActiveSubscription": true,
            "createdAt": "2024-01-15T10:30:00Z",
            "subscriptions": [
              {
                "subscriptionId": "sub-456",
                "status": "ACTIVE",
                "plan": {
                  "refId": "plan-pro"
                }
              }
            ]
          },
          "cursor": "abc123"
        }
      ],
      "pageInfo": {
        "hasNextPage": true,
        "hasPreviousPage": false,
        "startCursor": "abc123",
        "endCursor": "xyz789"
      },
      "totalCount": 150
    }
  }
}

Parameters

filter
CustomerFilter
Filter criteria for customers
paging
CursorPaging
Pagination options
sorting
[CustomerSort]
Sorting options

Return Type

Returns a CustomerConnection with:
FieldTypeDescription
edges[CustomerEdge]List of customer edges
edges.nodeCustomerThe customer object
edges.cursorStringCursor for pagination
pageInfoPageInfoPagination metadata
totalCountIntTotal number of matching customers

Filter Examples

Find customers by email domain

{
  "filter": {
    "email": { "like": "%@acme.com" }
  }
}

Find customers created this month

{
  "filter": {
    "createdAt": { "gte": "2024-01-01T00:00:00Z" }
  }
}

Find customers with specific subscription status

{
  "filter": {
    "subscriptions": {
      "status": { "eq": "ACTIVE" }
    }
  }
}
{
  "filter": {
    "searchQuery": { "like": "acme" }
  }
}

Common Use Cases

Display paginated list of customers with search and filtering capabilities.
Iterate through all customers using pagination for data export.
Filter customers subscribed to a specific plan.