Filter Builder
Overview
getFilterBuilderData returns everything you need to build a filter UI — or to programmatically pick valid facets.include / facets.exclude values when composing an Advanced Strategy. For a given asset type it hands back:
- The list of facet fields that exist on that asset type (e.g.
asset_data.subcategory,config_data.rarity) - For any facet fields you ask about: every value seen in the catalog plus the product count behind it
- A live product preview so you can sanity-check that your filter resolves to real inventory
It accepts the same fv* knobs that GroupedStrategyConfig.filterCriteria does, so you can preview exactly what a strategy would match before saving it.
Get Filter Builder Data
query GetFilterBuilderData($input: FilterBuilderInput!) {
getFilterBuilderData(input: $input) {
availableFacetFields
facets {
fieldName
totalValues
counts {
value
count
}
}
totalProducts
preview {
id
assetTypeName
name
slug
primaryImageUrl
}
error { message code }
}
}
Input Fields
| Field | Type | Required | Description |
|---|---|---|---|
| assetTypeId | ID | Yes | Asset type to explore — see Asset Types |
| facetFields | [String] | No | Subset of facet fields to expand value counts for. Omit to get all available fields (heavier) |
| activeFilters | JSON | No | Map of { field → [values] } to apply before counting. Use to preview "if I filtered by X, what's left?" |
| facetRanges | JSON | No | Map of { numericField → bound } to apply before counting, e.g. { "asset_data.release_year": { "greaterThanOrEqual": 2015, "lessThanOrEqual": 2020 } }. Bound keys: greaterThan / greaterThanOrEqual / lessThan / lessThanOrEqual / equalTo. Same shape a strategy's filterCriteria.facetRanges accepts |
| query | String | No | Text query narrowing results |
| fvMinCents | Int | No | Inclusive lower bound on fair value |
| fvMaxCents | Int | No | Inclusive upper bound on fair value |
| fvKeyIds | [String] | No | Restrict to specific product variants (e.g. PSA 10 vs PSA 9) |
| fvModelConfigId | String | No | Fair-value model config to evaluate against — see Fair Value → Model Configs |
| fvConfidenceMin | Float | No | Confidence floor (0–1) |
| maxFacetValues | Int | No | Cap on values returned per facet (default 50) |
| previewLimit | Int | No | Number of products in preview (default 12) |
| previewOffset | Int | No | Pagination offset for preview (default 0) |
| skipFacets | Boolean | No | Skip facet computation and only return preview + totalProducts. Faster when you only need a count or list |
Discover All Facet Fields for an Asset Type
Use this when you don't yet know what fields are available. The response's availableFacetFields lists every facet field that exists on the asset type; you can then drill into specific ones with a follow-up call.
{
"query": "query GetFilterBuilderData($input: FilterBuilderInput!) { getFilterBuilderData(input: $input) { availableFacetFields totalProducts error { message code } } }",
"variables": {
"input": {
"assetTypeId": "550e8400-e29b-41d4-a716-446655440000",
"skipFacets": true
}
}
}
Expand Specific Facet Values
Once you know the field names, request value counts for just the ones you care about.
{
"query": "query GetFilterBuilderData($input: FilterBuilderInput!) { getFilterBuilderData(input: $input) { facets { fieldName counts { value count } } totalProducts error { message code } } }",
"variables": {
"input": {
"assetTypeId": "550e8400-e29b-41d4-a716-446655440000",
"facetFields": ["asset_data.subcategory", "config_data.rarity"]
}
}
}
Preview What a Strategy Would Match
Pass the same fv* and activeFilters you intend to use in an Advanced Strategy. totalProducts tells you how many products the strategy would target right now, and preview shows a sample.
{
"query": "query GetFilterBuilderData($input: FilterBuilderInput!) { getFilterBuilderData(input: $input) { totalProducts preview { id name } error { message code } } }",
"variables": {
"input": {
"assetTypeId": "550e8400-e29b-41d4-a716-446655440000",
"fvModelConfigId": "660e8400-e29b-41d4-a716-446655440000",
"fvMinCents": 5000,
"fvMaxCents": 50000,
"fvConfidenceMin": 0.7,
"activeFilters": {
"asset_data.subcategory": ["POKEMON_CARDS"]
},
"previewLimit": 24
}
}
}
FilterBuilderPayload Type
| Field | Type | Description |
|---|---|---|
availableFacetFields | [String!]! | Every facet field name available for this asset type. Use these as keys in facets.include / facets.exclude |
availableFacetFieldDefs | [FacetFieldDef!]! | The same fields, each paired with a human-readable label for a filter UI. Render label; key facets.include / facets.exclude on field |
facets | [FacetFieldResult!]! | Value counts for the fields you requested |
totalProducts | Int! | Total product count after applying filters |
preview | [ProductSearchResult!]! | Sample products matching the filters |
error | Error | Set when the request failed |
FacetFieldResult
| Field | Type | Description |
|---|---|---|
fieldName | String! | Facet field name (matches a key in availableFacetFields) |
totalValues | Int! | Total distinct values seen (may exceed counts.length when maxFacetValues truncates) |
counts | [FacetValueCount!]! | Per-value counts |
FacetValueCount
| Field | Type | Description |
|---|---|---|
value | String! | Facet value (pass this through to facets.include / facets.exclude in a strategy) |
count | Int! | Number of products carrying that value under the current filters |
FacetFieldDef
| Field | Type | Description |
|---|---|---|
field | String! | Facet field path — the value to key facets.include / facets.exclude on (matches an entry in availableFacetFields) |
label | String! | Human-readable display name for the field, resolved per asset type. Distinct fields that share a leaf name (e.g. an asset-level vs config-level name) get distinct labels |
Using Filter Builder Data with Advanced Strategies
fieldName and value returned here map directly onto filterCriteria.facets in a grouped strategy. Discover, then save:
{
"input": {
"groupId": "770e8400-e29b-41d4-a716-446655440000",
"name": "PSA 10 Pokémon — $50 to $500",
"strategyConfig": {
"filter_criteria": {
"fv_model_config_id": "660e8400-e29b-41d4-a716-446655440000",
"fv_min_cents": 5000,
"fv_max_cents": 50000,
"facets": {
"include": { "asset_data.subcategory": ["POKEMON_CARDS"] },
"exclude": { "config_data.rarity": ["Common", "Uncommon"] }
}
},
"variance": { "below_fv": { "unit": "PCT", "value": 0.20 } },
"target_quantity": 100
}
}
}
See Advanced Strategies for the full GroupedStrategyConfig reference.
← Catalog | Advanced Strategies →
© 2026 Tradepost Markets Inc. All rights reserved.