> ## Documentation Index
> Fetch the complete documentation index at: https://docs.occtoo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# previewCardPredicates

> Tests predicates on the first `sampleSize` live entries of a card definition, by ascending entry id, so repeated calls return the same entries. The result covers only those entries.



**query** `previewCardPredicates(applicability: Predicate, cardId: String!, evidenceConditions: [PredicateEvidenceConditionInput!], predicates: [Predicate!]!, sampleSize: Int!): PredicateSample`

## Arguments

**`applicability`**: `Predicate`

Decides which sampled entries the predicates apply to. An entry that doesn't match it has `applicable: false` and every `matches` false. Null applies them to every entry.

---

**`cardId`**: `String!` (required)

Raw id of the card definition (e.g. `products`), not the global `CardDefinition.id`.

---

**`evidenceConditions`**: `[PredicateEvidenceConditionInput!]`

Predicates, by index into `predicates`, to collect failure evidence for. Null collects none.

---

**`predicates`**: `[Predicate!]!` (required)

Predicates to test, at least one. Each sampled entry's `matches` has one result per item, in the same order. Together with `applicability`, at most 513 predicates and 1 MiB as JSON, and `sampleSize` times their count at most 10,000. Over a limit fails with `BAD_USER_INPUT` and a message starting `PREVIEW_LIMIT_EXCEEDED:`.

---

**`sampleSize`**: `Int!` = 25

Number of entries to sample, 1 to 100. Default 25.

## Returns

`PredicateSample`

**`entries`**: `[PredicateSampleEntry!]!`

The sampled entries, in ascending `entryId` order.

---

**`evaluatedAt`**: `DateTime!`

When the sample was evaluated.

## Examples

```graphql Query
query PreviewCardPredicates($cardId: String!, $predicates: [Predicate!]!) {
  previewCardPredicates(cardId: $cardId, predicates: $predicates) {
    entries {
      applicable
      entryId
      evidence {
        conditionIndex
        evidence {
          __typename
        }
      }
      matches
    }
    evaluatedAt
  }
}
```

```json Variables
{
  "cardId": "string",
  "predicates": [
    {}
  ]
}
```

```json Response
{
  "data": {
    "previewCardPredicates": {
      "entries": [
        {
          "applicable": true,
          "entryId": "string",
          "evidence": [
            {
              "conditionIndex": 1,
              "evidence": {
                "__typename": "LifecycleRuleEvidence"
              }
            }
          ],
          "matches": [
            true
          ]
        }
      ],
      "evaluatedAt": "value"
    }
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.