younifyd
Menu

collectionReorderProducts

Asynchronously reorders products within a specified collection. Instead of returning an updated collection, this mutation returns a job, which should be polled.

Use it in a workflow

  1. Add a step and choose the Shopify connector.
  2. Pick the collectionReorderProducts action (under Collection).
  3. Fill in the fields below, then reference the result from later steps as {{collectionreorderproducts.response.data}}.

Query

This is the mutation the action sends by default. Edit it in the step's Query field to change which fields come back.

graphql
mutation CollectionReorderProducts($id: ID!, $moves: [MoveInput!]!) {
  collectionReorderProducts(id: $id, moves: $moves) {
    job {
      done
      id
      query {
        appDiscountTypes
        availableBackupRegions
        availableCarrierServices
        availableLocales
        backupRegion
        businessEntities
        catalogOperations
        collectionConditionMetafieldDefinitions
        collectionRulesConditions
        consentPolicyRegions
        currentAppInstallation
        currentStaffMember
        deliveryPromiseSettings
        financeAppAccessPolicy
        financeKycInformation
        fulfillmentConstraintRules
        giftCardConfiguration
        inventoryProperties
        locationsAvailableForDeliveryProfiles
        metafieldDefinitionTypes
        onlineStore
        pendingOrdersCount
        primaryMarket
        privacySettings
        publicApiVersions
        serverPixel
        shop
        shopBillingPreferences
        shopifyPaymentsAccount
        storeCreditConfiguration
        taxonomy
      }
    }
    userErrors {
      code
      field
      message
    }
  }
}

Variables

Pass these as a JSON object in the step's Variables field.

idstringrequired

The ID of the collection on which to reorder products.

movesarray<object>required

A list of moves to perform, evaluated in order. Provide only products whose positions changed; do not send the full list. `newPosition` is a zero-based index evaluated at the time each move is applied (after any prior moves). `newPosition` values do not need to be unique, and if a value is greater than or equal to the number of products, the product is moved to the end. Up to 250 moves are supported.

idstringrequired
newPositionstringrequired
json
{
  "id": "string",
  "moves": [
    {
      "id": "string",
      "newPosition": "string"
    }
  ]
}

Response

Read the result with {{collectionreorderproducts.response.data.data.collectionReorderProducts}}. If the API returns errors, the step fails and they are at {{collectionreorderproducts.response.data.errors}}.

jobobject
doneboolean
idstring
queryobject31 fields
userErrorsarray<object>
codeobject
fieldobject
messageobject

Need more? See the Shopify guide for connection setup and behaviour shared by every action.

collectionReorderProducts — Shopify — Documentation