Skip to content
Back to skills

2591 Graphql Mutations 36c79194

ASecurity

Key mutations for product management via the Admin API.

  • 9 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added May 31, 2026
content-marketinggonodeapi

Works with

  • cursor
  • api

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned May 31, 2026

npx -y skills add tools-only/X-Skills --skill 2591-graphql-mutations_36c79194 --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of 2591 Graphql Mutations 36c79194?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for 2591 Graphql Mutations 36c79194
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tools-only-2591-graphql-mutations-36c79194/badge)](https://www.skillsdirectory.com/skills/tools-only-2591-graphql-mutations-36c79194)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
# Shopify Product GraphQL Mutations

Key mutations for product management via the Admin API.

## Product CRUD

### productCreate

```graphql
mutation productCreate($product: ProductCreateInput!) {
  productCreate(product: $product) {
    product {
      id
      title
      handle
      status
      variants(first: 100) {
        edges {
          node { id title price sku inventoryQuantity }
        }
      }
    }
    userErrors { field message }
  }
}
```

Variables:
```json
{
  "product": {
    "title": "Product Name",
    "descriptionHtml": "<p>Description</p>",
    "vendor": "Brand",
    "productType": "Category",
    "tags": ["tag1", "tag2"],
    "status": "DRAFT",
    "options": ["Size", "Colour"],
    "variants": [
      {
        "optionValues": [
          {"optionName": "Size", "name": "S"},
          {"optionName": "Colour", "name": "Red"}
        ],
        "price": "29.95",
        "sku": "PROD-S-RED",
        "inventoryPolicy": "DENY",
        "inventoryItem": {
          "tracked": true
        }
      }
    ],
    "seo": {
      "title": "SEO Title",
      "description": "Meta description"
    }
  }
}
```

### productUpdate

```graphql
mutation productUpdate($input: ProductInput!) {
  productUpdate(input: $input) {
    product { id title }
    userErrors { field message }
  }
}
```

Variables include `id` (required) plus any fields to update.

### productDelete

```graphql
mutation productDelete($input: ProductDeleteInput!) {
  productDelete(input: $input) {
    deletedProductId
    userErrors { field message }
  }
}
```

## Variant Management

### productVariantsBulkCreate

For adding variants to an existing product:

```graphql
mutation productVariantsBulkCreate($productId: ID!, $variants: [ProductVariantsBulkInput!]!) {
  productVariantsBulkCreate(productId: $productId, variants: $variants) {
    productVariants { id title price }
    userErrors { field message }
  }
}
```

### productVariantsBulkUpdate

```graphql
mutation productVariantsBulkUpdate($productId: ID!, $variants: [ProductVariantsBulkInput!]!) {
  productVariantsBulkUpdate(productId: $productId, variants: $variants) {
    productVariants { id title price }
    userErrors { field message }
  }
}
```

## Image Upload

### stagedUploadsCreate

```graphql
mutation stagedUploadsCreate($input: [StagedUploadInput!]!) {
  stagedUploadsCreate(input: $input) {
    stagedTargets {
      url
      resourceUrl
      parameters { name value }
    }
    userErrors { field message }
  }
}
```

Input per file:
```json
{
  "filename": "image.jpg",
  "mimeType": "image/jpeg",
  "httpMethod": "POST",
  "resource": "IMAGE"
}
```

After uploading to the staged URL, attach with `productCreateMedia`.

### productCreateMedia

```graphql
mutation productCreateMedia($productId: ID!, $media: [CreateMediaInput!]!) {
  productCreateMedia(productId: $productId, media: $media) {
    media { alt status }
    mediaUserErrors { field message }
  }
}
```

## Collection Assignment

### collectionAddProducts

```graphql
mutation collectionAddProducts($id: ID!, $productIds: [ID!]!) {
  collectionAddProducts(id: $id, productIds: $productIds) {
    collection { title productsCount }
    userErrors { field message }
  }
}
```

## Inventory

### inventorySetQuantities

```graphql
mutation inventorySetQuantities($input: InventorySetQuantitiesInput!) {
  inventorySetQuantities(input: $input) {
    inventoryAdjustmentGroup { reason }
    userErrors { field message }
  }
}
```

Input:
```json
{
  "reason": "correction",
  "name": "available",
  "quantities": [{
    "inventoryItemId": "gid://shopify/InventoryItem/123",
    "locationId": "gid://shopify/Location/456",
    "quantity": 50
  }]
}
```

## Useful Queries

### Get all products

```graphql
{
  products(first: 50) {
    edges {
      node {
        id title handle status productType vendor
        variants(first: 10) {
          edges { node { id title price sku inventoryQuantity } }
        }
      }
    }
    pageInfo { hasNextPage endCursor }
  }
}
```

### Get all collections

```graphql
{
  collections(first: 50) {
    edges {
      node { id title handle productsCount }
    }
  }
}
```

### Get inventory locations

```graphql
{
  locations(first: 10) {
    edges {
      node { id name isActive }
    }
  }
}
```

Files in this skill

  • README.md921 B
  • skill.md4.2 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.