Admin API / Queries

products

Listings of every seller. Requires the MODERATOR role or higher. A MODERATOR reads every PUBLIC listing, and every listing of the sellers that it acts for: the caller, and the owner of each store where the caller is staff. An ADMIN or OWNER reads every listing, hidden ones included. Deleted listings are listed only with includeDeleted: true. Defaults to RELEVANCE descending when query has a word, else createdAt descending. A cursor marks a position in the sort. A listing whose sort key changes between pages can move across it. The list has no row limit. To filter by a seller's username, read the seller's ID with userByUsername. Fails with VALIDATION_ERROR for a where list of more than 100 values.

Requires a client key with one of these scopes: admin:products:readRequires this member role or higher: MODERATOR
products(
  after: String
  first: Int
  includeDeleted: Boolean! = false
  query: String
  sort: ProductSortInput
  where: ProductWhereInput
): ProductConnection!

Arguments

ArgumentTypeDescription
afterStringReturn items after this cursor. A cursor continues only the sort that issued it. A RELEVANCE cursor also continues only the query that issued it.
firstIntMaximum number of items to return. Defaults to 20, capped at 100 (10,000 for Soho).
includeDeletedBoolean!True: the list also returns deleted listings, each with lifecycle: DELETED. They are the deleted listings of the sellers that the caller acts for, and every deleted listing for an ADMIN or OWNER. A MODERATOR gets no deleted listing of another seller. A delete moves updatedAt, so a read of an updatedAt range finds the listings deleted in it. Default: false.
queryStringMatches words in the title and the description, case-insensitive. Each word matches as a prefix, and every word must match: "blu jack" matches "Blue jacket". Search operators and quotes are ignored. The whole trimmed text, quotes and operators included, also matches a custom order whose buyer's username or name contains it, case-insensitive, when the caller can read the listing's customOrder. Text with no word applies no filter.
sortProductSortInputSort order. Defaults to RELEVANCE descending when query has a word, else createdAt descending.
whereProductWhereInputFilters to narrow the list.

Return type

ProductConnection!