Skip to main content

itemSearch Query

Description

Searches for items by term, matching against title, description, barcode, SKU, identifiers, item ID, Discogs ID, or listing ID. Results are sorted by relevance and can be filtered by type and stock availability.

query itemSearch(
$term: String!
$type: String
$quantitySort: Boolean
$stocked: Boolean
) {
itemSearch(
term: $term
type: $type
quantitySort: $quantitySort
stocked: $stocked
) {
entries {
_id
id
type
incId
uniqueId
oldId
created
modified
isForbiddenForSale
handle
path
uri
wants
bitly
}
pagination {
limit
count
page
pages
hasMore
}
}
}

Variables

{
"term": "term",
"type": "type",
"quantitySort": true,
"stocked": true
}

Response

{
"itemSearch": {
"entries": [
{
"_id": "b8aa0396f59e97314cd8b945",
"id": 1.23,
"type": "ReleaseItem",
"incId": 1.23,
"uniqueId": "example",
"oldId": 1.23,
"created": 1719947238738,
"modified": 1763228010071,
"isForbiddenForSale": true,
"handle": "example",
"path": "/release/1763553751/release-artist-release-name",
"uri": "https://www.my-common-ground-store.com/release/1763553751/release-artist-release-name",
"wants": 42,
"bitly": "example"
}
],
"pagination": {
"limit": 20,
"count": 10,
"page": 1,
"pages": 1,
"hasMore": true
}
}
}

Arguments

NameTypeDescription
termString!Search term to match against item titles, descriptions, barcodes, SKUs, identifiers, or IDs.
typeStringItem type to filter results by (e.g., "ReleaseItem", "BookItem", "ProductItem").
quantitySortBooleanWhether to sort results by stock quantity, showing items with stock first.
stockedBooleanWhether to filter results to show only items with stock quantity greater than 0.

Returns

ItemSearchResults