---
title: CodeDiscountSortKeys - GraphQL Admin
description: The set of valid sort keys for the CodeDiscount query.
api_version: 2026-10
source_url:
  html: https://shopify.dev/docs/api/admin-graphql/latest/enums/codediscountsortkeys
  md: https://shopify.dev/docs/api/admin-graphql/latest/enums/codediscountsortkeys.md
---

# CodeDiscountSortKeys

enum

The set of valid sort keys for the CodeDiscount query.

## Valid values

* CREATED\_AT

  Sort by the `created_at` value.

* ENDS\_AT

  Sort by the `ends_at` value.

* ID

  Sort by the `id` value.

* RELEVANCE

  Sort by relevance to the search terms when the `query` parameter is specified on the connection. Don't use this sort key when no search query is specified.

* STARTS\_AT

  Sort by the `starts_at` value.

* TITLE

  Sort by the `title` value.

* UPDATED\_AT

  Sort by the `updated_at` value.

***

## Fields

* [QueryRoot.codeDiscountNodes(sortKey)](https://shopify.dev/docs/api/admin-graphql/latest/objects/QueryRoot#field-QueryRoot.fields.codeDiscountNodes.arguments.sortKey)

  ARGUMENT

  The schema's entry-point for queries. This acts as the public, top-level API from which all queries must start.

* [codeDiscountNodes.sortKey](https://shopify.dev/docs/api/admin-graphql/latest/queries/codeDiscountNodes#arguments-sortKey)

  ARGUMENT

***

## Map

### Arguments with this enum

* [QueryRoot.codeDiscountNodes(sortKey)](https://shopify.dev/docs/api/admin-graphql/latest/objects/QueryRoot#field-QueryRoot.fields.codeDiscountNodes.arguments.sortKey)
* [codeDiscountNodes.sortKey](https://shopify.dev/docs/api/admin-graphql/latest/queries/codeDiscountNodes#arguments-sortKey)