QueryRoot

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

Show definition
# The schema's entry-point for queries. This acts as the public, top-level API from which all queries must start.
type QueryRoot {
  # Lookup an App by ID or return the currently authenticated App.
  app(
    # The ID to lookup the App by.
    id: ID
  ): App

  # Fetches app by handle.
  # Returns null if the app doesn't exist.
  appByHandle(
    # Handle of the App.
    handle: String!
  ): App

  # Fetches app by apiKey.
  # Returns null if the app doesn't exist.
  appByKey(
    # API key of the App.
    apiKey: String!
  ): App

  # Lookup an AppInstallation by ID or return the AppInstallation for the currently authenticated App.
  appInstallation(
    # ID used to lookup AppInstallation.
    id: ID
  ): AppInstallation

  # List of app installations.
  appInstallations(
    # Returns up to the first `n` elements from the list.
    first: Int

    # Returns the elements that come after the specified cursor.
    after: String

    # Returns up to the last `n` elements from the list.
    last: Int

    # Returns the elements that come before the specified cursor.
    before: String

    # Reverse the order of the underlying list.
    reverse: Boolean = false

    # Sort the underlying list by the given key.
    sortKey: AppInstallationSortKeys = INSTALLED_AT

    # The category of app installations to fetch.
    category: AppInstallationCategory

    # The privacy level of app installations to fetch.
    privacy: AppInstallationPrivacy = PUBLIC
  ): AppInstallationConnection!

  # Lookup a channel by ID.
  channel(
    # The ID of the Channel to return.
    id: ID!
  ): Channel

  # List of the active sales channels.
  channels(
    # Returns up to the first `n` elements from the list.
    first: Int

    # Returns the elements that come after the specified cursor.
    after: String

    # Returns up to the last `n` elements from the list.
    last: Int

    # Returns the elements that come before the specified cursor.
    before: String

    # Reverse the order of the underlying list.
    reverse: Boolean = false
  ): ChannelConnection!

  # Returns a Collection resource by ID.
  collection(
    # The ID of the Collection to return.
    id: ID!
  ): Collection

  # Return a collection by its handle.
  collectionByHandle(
    # The handle of the collection.
    handle: String!
  ): Collection

  # A list of rule conditions to define how collections with rules can be created.
  collectionRulesConditions: [CollectionRuleConditions!]!

  # List of collections.
  collections(
    # Returns up to the first `n` elements from the list.
    first: Int

    # Returns the elements that come after the specified cursor.
    after: String

    # Returns up to the last `n` elements from the list.
    last: Int

    # Returns the elements that come before the specified cursor.
    before: String

    # Reverse the order of the underlying list.
    reverse: Boolean = false

    # Sort the underlying list by the given key.
    sortKey: CollectionSortKeys = ID

    # Supported filter parameters:
    #  - `title`
    #  - `collection_type`
    #  - `updated_at`
    #  - `published_status`
    query: String

    # ID of an existing saved search.
    # The search’s query string will be used as the query argument.
    savedSearchId: ID
  ): CollectionConnection!

  # Return the AppInstallation for the currently authenticated App.
  currentAppInstallation: AppInstallation!

  # Returns a Customer resource by ID.
  customer(
    # The ID of the Customer to return.
    id: ID!
  ): Customer

  # List of customer accounts.
  customers(
    # Returns up to the first `n` elements from the list.
    first: Int

    # Returns the elements that come after the specified cursor.
    after: String

    # Returns up to the last `n` elements from the list.
    last: Int

    # Returns the elements that come before the specified cursor.
    before: String

    # Reverse the order of the underlying list.
    reverse: Boolean = false

    # Sort the underlying list by the given key.
    sortKey: CustomerSortKeys = ID

    # Supported filter parameters:
    #  - `total_spent`
    #  - `orders_count`
    #  - `order_date`
    #  - `accepts_marketing`
    #  - `last_abandoned_order_date`
    #  - `state`
    #  - `country`
    #  - `email`
    #  - `phone`
    #  - `customer_date`
    #  - `updated_at`
    #  - `tag`
    query: String
  ): CustomerConnection!

  # The paginated list of deletion events.
  deletionEvents(
    # Returns up to the first `n` elements from the list.
    first: Int

    # Returns the elements that come after the specified cursor.
    after: String

    # Returns up to the last `n` elements from the list.
    last: Int

    # Returns the elements that come before the specified cursor.
    before: String

    # Reverse the order of the underlying list.
    reverse: Boolean = false

    # Sort the underlying list by the given key.
    sortKey: DeletionEventSortKeys = ID

    # Supported filter parameters:
    #  - `occurred_at`
    query: String

    # List of subject types to filter by.
    subjectTypes: [DeletionEventSubjectType!]
  ): DeletionEventConnection!

  # Returns a DraftOrder resource by ID.
  draftOrder(
    # The ID of the DraftOrder to return.
    id: ID!
  ): DraftOrder

  # List of saved draft orders.
  draftOrders(
    # Returns up to the first `n` elements from the list.
    first: Int

    # Returns the elements that come after the specified cursor.
    after: String

    # Returns up to the last `n` elements from the list.
    last: Int

    # Returns the elements that come before the specified cursor.
    before: String

    # Reverse the order of the underlying list.
    reverse: Boolean = false

    # Sort the underlying list by the given key.
    sortKey: DraftOrderSortKeys = ID

    # Supported filter parameters:
    #  - `status`
    #  - `updated_at`
    #  - `customer_id`
    #  - `created_at`
    #  - `tag`
    query: String
  ): DraftOrderConnection!

  # Returns a Fulfillment resource by ID.
  fulfillment(
    # The ID of the Fulfillment to return.
    id: ID!
  ): Fulfillment

  # Returns an InventoryItem resource by ID.
  inventoryItem(
    # The ID of the InventoryItem to return.
    id: ID!
  ): InventoryItem

  # List of inventory items.
  inventoryItems(
    # Returns up to the first `n` elements from the list.
    first: Int

    # Returns the elements that come after the specified cursor.
    after: String

    # Returns up to the last `n` elements from the list.
    last: Int

    # Returns the elements that come before the specified cursor.
    before: String

    # Reverse the order of the underlying list.
    reverse: Boolean = false

    # Supported filter parameters:
    #  - `id`
    #  - `sku`
    #  - `updated_at`
    #  - `created_at`
    query: String
  ): InventoryItemConnection!

  # Returns an InventoryLevel resource by ID.
  inventoryLevel(
    # The ID of the InventoryLevel to return.
    id: ID!
  ): InventoryLevel

  # Returns a Job resource by ID. Used to check the status of internal jobs and any applicable changes.
  job(
    # ID of the job to query
    id: ID!
  ): Job

  # Returns an inventory Location resource by ID.
  location(
    # The ID of the location to return. If no ID is provided, the primary location of the Shop is returned.
    id: ID
  ): Location

  # List of active locations.
  locations(
    # Returns up to the first `n` elements from the list.
    first: Int

    # Returns the elements that come after the specified cursor.
    after: String

    # Returns up to the last `n` elements from the list.
    last: Int

    # Returns the elements that come before the specified cursor.
    before: String

    # Reverse the order of the underlying list.
    reverse: Boolean = false

    # Sort the underlying list by the given key.
    sortKey: LocationSortKeys = NAME

    # Supported filter parameters:
    #  - `name`
    #  - `address1`
    #  - `address2`
    #  - `city`
    #  - `zip`
    #  - `province`
    #  - `country`
    #  - `active`
    #  - `legacy`
    query: String

    # If true, also include the legacy locations of fulfillment services.
    includeLegacy: Boolean = false

    # If true, also include the locations that are deactivated.
    includeInactive: Boolean = false
  ): LocationConnection!

  # Returns a MarketingActivity resource by ID.
  marketingActivity(
    # The ID of the MarketingActivity to return.
    id: ID!
  ): MarketingActivity

  # Returns a MarketingEvent resource by ID.
  marketingEvent(
    # The ID of the MarketingEvent to return.
    id: ID!
  ): MarketingEvent

  # Returns a specific node by ID.
  node(
    # The ID of the Node to return.
    id: ID!
  ): Node

  # Returns the list of nodes with the given IDs.
  nodes(
    # The IDs of the Nodes to return.
    ids: [ID!]!
  ): [Node]!

  # Returns an Order resource by ID.
  order(
    # The ID of the Order to return.
    id: ID!
  ): Order

  # List of orders placed.
  orders(
    # Returns up to the first `n` elements from the list.
    first: Int

    # Returns the elements that come after the specified cursor.
    after: String

    # Returns up to the last `n` elements from the list.
    last: Int

    # Returns the elements that come before the specified cursor.
    before: String

    # Reverse the order of the underlying list.
    reverse: Boolean = false

    # Sort the underlying list by the given key.
    sortKey: OrderSortKeys = PROCESSED_AT

    # Supported filter parameters:
    #  - `status`
    #  - `financial_status`
    #  - `fulfillment_status`
    #  - `source_name`
    #  - `chargeback_status`
    #  - `risk_level`
    #  - `customer_id`
    #  - `email`
    #  - `credit_card_last4`
    #  - `processed_at`
    #  - `checkout_token`
    #  - `cart_token`
    #  - `location_id`
    #  - `channel_id`
    #  - `sales_channel`
    #  - `discount_code`
    #  - `test`
    #  - `fraud_protection_level`
    #  - `reference_location_id`
    #  - `tag`
    #  - `updated_at`
    #  - `created_at`
    query: String
  ): OrderConnection!

  # Lookup a price rule by ID.
  priceRule(
    # The ID of the PriceRule to return.
    id: ID!
  ): PriceRule

  # List of price rules.
  priceRules(
    # Returns up to the first `n` elements from the list.
    first: Int

    # Returns the elements that come after the specified cursor.
    after: String

    # Returns up to the last `n` elements from the list.
    last: Int

    # Returns the elements that come before the specified cursor.
    before: String

    # Reverse the order of the underlying list.
    reverse: Boolean = false

    # Sort the underlying list by the given key.
    sortKey: PriceRuleSortKeys = ID

    # Supported filter parameters:
    #  - `starts_at`
    #  - `ends_at`
    #  - `status`
    #  - `discount_type`
    #  - `times_used`
    #  - `updated_at`
    #  - `created_at`
    query: String

    # ID of an existing saved search.
    # The search’s query string will be used as the query argument.
    savedSearchId: ID
  ): PriceRuleConnection!

  # Returns a Product resource by ID.
  product(
    # The ID of the Product to return.
    id: ID!
  ): Product

  # Return a product by its handle.
  productByHandle(
    # The handle of the product.
    handle: String!
  ): Product

  # Returns a ProductVariant resource by ID.
  productVariant(
    # The ID of the ProductVariant to return.
    id: ID!
  ): ProductVariant

  # List of the product variants.
  productVariants(
    # Returns up to the first `n` elements from the list.
    first: Int

    # Returns the elements that come after the specified cursor.
    after: String

    # Returns up to the last `n` elements from the list.
    last: Int

    # Returns the elements that come before the specified cursor.
    before: String

    # Reverse the order of the underlying list.
    reverse: Boolean = false

    # Sort the underlying list by the given key.
    sortKey: ProductVariantSortKeys = ID

    # Supported filter parameters:
    #  - `title`
    #  - `product_type`
    #  - `vendor`
    #  - `managed`
    #  - `managed_by`
    #  - `inventory_quantity`
    #  - `product_id`
    #  - `collection`
    #  - `gift_card`
    #  - `barcode`
    #  - `location_id`
    #  - `updated_at`
    #  - `sku`
    #  - `published_status`
    #  - `tag`
    query: String
  ): ProductVariantConnection!

  # List of products.
  products(
    # Returns up to the first `n` elements from the list.
    first: Int

    # Returns the elements that come after the specified cursor.
    after: String

    # Returns up to the last `n` elements from the list.
    last: Int

    # Returns the elements that come before the specified cursor.
    before: String

    # Reverse the order of the underlying list.
    reverse: Boolean = false

    # Sort the underlying list by the given key.
    sortKey: ProductSortKeys = ID

    # Supported filter parameters:
    #  - `title`
    #  - `product_type`
    #  - `vendor`
    #  - `gift_card`
    #  - `sku`
    #  - `barcode`
    #  - `inventory_total`
    #  - `created_at`
    #  - `updated_at`
    #  - `out_of_stock_somewhere`
    #  - `published_status`
    #  - `tag`
    #  - `error_feedback`
    query: String

    # ID of an existing saved search.
    # The search’s query string will be used as the query argument.
    savedSearchId: ID
  ): ProductConnection!

  # Returns a Refund resource by ID.
  refund(
    # The ID of the Refund to return.
    id: ID!
  ): Refund

  # Returns a Shop resource corresponding to access token used in request.
  shop: Shop!
}

Connections

appInstallations   (AppInstallationConnection!)

List of app installations.

Required access

read_apps access scope

Argument Type Default Description
after String

Returns the elements that come after the specified cursor.

before String

Returns the elements that come before the specified cursor.

category AppInstallationCategory

The category of app installations to fetch.

first Int

Returns up to the first n elements from the list.

last Int

Returns up to the last n elements from the list.

privacy AppInstallationPrivacy PUBLIC

The privacy level of app installations to fetch.

reverse Boolean false

Reverse the order of the underlying list.

sortKey AppInstallationSortKeys INSTALLED_AT

Sort the underlying list by the given key.

channels   (ChannelConnection!)

List of the active sales channels.

Argument Type Default Description
after String

Returns the elements that come after the specified cursor.

before String

Returns the elements that come before the specified cursor.

first Int

Returns up to the first n elements from the list.

last Int

Returns up to the last n elements from the list.

reverse Boolean false

Reverse the order of the underlying list.

collections   (CollectionConnection!)

List of collections.

Argument Type Default Description
after String

Returns the elements that come after the specified cursor.

before String

Returns the elements that come before the specified cursor.

first Int

Returns up to the first n elements from the list.

last Int

Returns up to the last n elements from the list.

query String

Supported filter parameters:

  • title
  • collection_type
  • updated_at
  • published_status
reverse Boolean false

Reverse the order of the underlying list.

savedSearchId ID

ID of an existing saved search. The search’s query string will be used as the query argument.

sortKey CollectionSortKeys ID

Sort the underlying list by the given key.

customers   (CustomerConnection!)

List of customer accounts.

Argument Type Default Description
after String

Returns the elements that come after the specified cursor.

before String

Returns the elements that come before the specified cursor.

first Int

Returns up to the first n elements from the list.

last Int

Returns up to the last n elements from the list.

query String

Supported filter parameters:

  • total_spent
  • orders_count
  • order_date
  • accepts_marketing
  • last_abandoned_order_date
  • state
  • country
  • email
  • phone
  • customer_date
  • updated_at
  • tag
reverse Boolean false

Reverse the order of the underlying list.

sortKey CustomerSortKeys ID

Sort the underlying list by the given key.

deletionEvents   (DeletionEventConnection!)

The paginated list of deletion events.

Argument Type Default Description
after String

Returns the elements that come after the specified cursor.

before String

Returns the elements that come before the specified cursor.

first Int

Returns up to the first n elements from the list.

last Int

Returns up to the last n elements from the list.

query String

Supported filter parameters:

  • occurred_at
reverse Boolean false

Reverse the order of the underlying list.

sortKey DeletionEventSortKeys ID

Sort the underlying list by the given key.

subjectTypes [DeletionEventSubjectType!]

List of subject types to filter by.

draftOrders   (DraftOrderConnection!)

List of saved draft orders.

Argument Type Default Description
after String

Returns the elements that come after the specified cursor.

before String

Returns the elements that come before the specified cursor.

first Int

Returns up to the first n elements from the list.

last Int

Returns up to the last n elements from the list.

query String

Supported filter parameters:

  • status
  • updated_at
  • customer_id
  • created_at
  • tag
reverse Boolean false

Reverse the order of the underlying list.

sortKey DraftOrderSortKeys ID

Sort the underlying list by the given key.

inventoryItems   (InventoryItemConnection!)

List of inventory items.

Argument Type Default Description
after String

Returns the elements that come after the specified cursor.

before String

Returns the elements that come before the specified cursor.

first Int

Returns up to the first n elements from the list.

last Int

Returns up to the last n elements from the list.

query String

Supported filter parameters:

  • id
  • sku
  • updated_at
  • created_at
reverse Boolean false

Reverse the order of the underlying list.

locations   (LocationConnection!)

List of active locations.

Argument Type Default Description
after String

Returns the elements that come after the specified cursor.

before String

Returns the elements that come before the specified cursor.

first Int

Returns up to the first n elements from the list.

includeInactive Boolean false

If true, also include the locations that are deactivated.

includeLegacy Boolean false

If true, also include the legacy locations of fulfillment services.

last Int

Returns up to the last n elements from the list.

query String

Supported filter parameters:

  • name
  • address1
  • address2
  • city
  • zip
  • province
  • country
  • active
  • legacy
reverse Boolean false

Reverse the order of the underlying list.

sortKey LocationSortKeys NAME

Sort the underlying list by the given key.

orders   (OrderConnection!)

List of orders placed.

Argument Type Default Description
after String

Returns the elements that come after the specified cursor.

before String

Returns the elements that come before the specified cursor.

first Int

Returns up to the first n elements from the list.

last Int

Returns up to the last n elements from the list.

query String

Supported filter parameters:

  • status
  • financial_status
  • fulfillment_status
  • source_name
  • chargeback_status
  • risk_level
  • customer_id
  • email
  • credit_card_last4
  • processed_at
  • checkout_token
  • cart_token
  • location_id
  • channel_id
  • sales_channel
  • discount_code
  • test
  • fraud_protection_level
  • reference_location_id
  • tag
  • updated_at
  • created_at
reverse Boolean false

Reverse the order of the underlying list.

sortKey OrderSortKeys PROCESSED_AT

Sort the underlying list by the given key.

priceRules   (PriceRuleConnection!)

List of price rules.

Argument Type Default Description
after String

Returns the elements that come after the specified cursor.

before String

Returns the elements that come before the specified cursor.

first Int

Returns up to the first n elements from the list.

last Int

Returns up to the last n elements from the list.

query String

Supported filter parameters:

  • starts_at
  • ends_at
  • status
  • discount_type
  • times_used
  • updated_at
  • created_at
reverse Boolean false

Reverse the order of the underlying list.

savedSearchId ID

ID of an existing saved search. The search’s query string will be used as the query argument.

sortKey PriceRuleSortKeys ID

Sort the underlying list by the given key.

productVariants   (ProductVariantConnection!)

List of the product variants.

Argument Type Default Description
after String

Returns the elements that come after the specified cursor.

before String

Returns the elements that come before the specified cursor.

first Int

Returns up to the first n elements from the list.

last Int

Returns up to the last n elements from the list.

query String

Supported filter parameters:

  • title
  • product_type
  • vendor
  • managed
  • managed_by
  • inventory_quantity
  • product_id
  • collection
  • gift_card
  • barcode
  • location_id
  • updated_at
  • sku
  • published_status
  • tag
reverse Boolean false

Reverse the order of the underlying list.

sortKey ProductVariantSortKeys ID

Sort the underlying list by the given key.

products   (ProductConnection!)

List of products.

Argument Type Default Description
after String

Returns the elements that come after the specified cursor.

before String

Returns the elements that come before the specified cursor.

first Int

Returns up to the first n elements from the list.

last Int

Returns up to the last n elements from the list.

query String

Supported filter parameters:

  • title
  • product_type
  • vendor
  • gift_card
  • sku
  • barcode
  • inventory_total
  • created_at
  • updated_at
  • out_of_stock_somewhere
  • published_status
  • tag
  • error_feedback
reverse Boolean false

Reverse the order of the underlying list.

savedSearchId ID

ID of an existing saved search. The search’s query string will be used as the query argument.

sortKey ProductSortKeys ID

Sort the underlying list by the given key.

Fields

app   (App)

Lookup an App by ID or return the currently authenticated App.

Argument Type Default Description
id ID

The ID to lookup the App by.

appByHandle   (App)

Fetches app by handle. Returns null if the app doesn't exist.

Argument Type Default Description
handle required String!

Handle of the App.

appByKey   (App)

Fetches app by apiKey. Returns null if the app doesn't exist.

Argument Type Default Description
apiKey required String!

API key of the App.

appInstallation   (AppInstallation)

Lookup an AppInstallation by ID or return the AppInstallation for the currently authenticated App.

Required access

read_apps access scope

Argument Type Default Description
id ID

ID used to lookup AppInstallation.

channel   (Channel)

Lookup a channel by ID.

Argument Type Default Description
id required ID!

The ID of the Channel to return.

collection   (Collection)

Returns a Collection resource by ID.

Argument Type Default Description
id required ID!

The ID of the Collection to return.

collectionByHandle   (Collection)

Return a collection by its handle.

Argument Type Default Description
handle required String!

The handle of the collection.

collectionRulesConditions   ([CollectionRuleConditions!]!)

A list of rule conditions to define how collections with rules can be created.

currentAppInstallation   (AppInstallation!)

Return the AppInstallation for the currently authenticated App.

customer   (Customer)

Returns a Customer resource by ID.

Argument Type Default Description
id required ID!

The ID of the Customer to return.

draftOrder   (DraftOrder)

Returns a DraftOrder resource by ID.

Argument Type Default Description
id required ID!

The ID of the DraftOrder to return.

fulfillment   (Fulfillment)

Returns a Fulfillment resource by ID.

Argument Type Default Description
id required ID!

The ID of the Fulfillment to return.

inventoryItem   (InventoryItem)

Returns an InventoryItem resource by ID.

Argument Type Default Description
id required ID!

The ID of the InventoryItem to return.

inventoryLevel   (InventoryLevel)

Returns an InventoryLevel resource by ID.

Argument Type Default Description
id required ID!

The ID of the InventoryLevel to return.

job   (Job)

Returns a Job resource by ID. Used to check the status of internal jobs and any applicable changes.

Argument Type Default Description
id required ID!

ID of the job to query

location   (Location)

Returns an inventory Location resource by ID.

Argument Type Default Description
id ID

The ID of the location to return. If no ID is provided, the primary location of the Shop is returned.

marketingActivity   (MarketingActivity)

Returns a MarketingActivity resource by ID.

Argument Type Default Description
id required ID!

The ID of the MarketingActivity to return.

marketingEvent   (MarketingEvent)

Returns a MarketingEvent resource by ID.

Argument Type Default Description
id required ID!

The ID of the MarketingEvent to return.

node   (Node)

Returns a specific node by ID.

Argument Type Default Description
id required ID!

The ID of the Node to return.

nodes   ([Node]!)

Returns the list of nodes with the given IDs.

Argument Type Default Description
ids required [ID!]!

The IDs of the Nodes to return.

order   (Order)

Returns an Order resource by ID.

Argument Type Default Description
id required ID!

The ID of the Order to return.

priceRule   (PriceRule)

Lookup a price rule by ID.

Argument Type Default Description
id required ID!

The ID of the PriceRule to return.

product   (Product)

Returns a Product resource by ID.

Argument Type Default Description
id required ID!

The ID of the Product to return.

productByHandle   (Product)

Return a product by its handle.

Argument Type Default Description
handle required String!

The handle of the product.

productVariant   (ProductVariant)

Returns a ProductVariant resource by ID.

Argument Type Default Description
id required ID!

The ID of the ProductVariant to return.

refund   (Refund)

Returns a Refund resource by ID.

Argument Type Default Description
id required ID!

The ID of the Refund to return.

shop   (Shop!)

Returns a Shop resource corresponding to access token used in request.