GraphQL, Ruby and syntax problem

Highlighted
Shopify Expert
3942 16 330

I am trying the mutation out to bulk update inventory. However, in trying to run the script, it bombs. I am not sure why.

The error I am seeing is: NameError: wrong constant name inventoryBulkAdjustQuantityAtLocation

 

How am I supposed to format this kind of mutation then? I am curious. Last thing I need to get working it seems.

 

BulkAdjustQuantityAtLocation = ShopifyGraphQLClient.parse <<-'GRAPHQL'
  mutation inventoryBulkAdjustQuantityAtLocation($inventoryItemAdjustments: [InventoryAdjustItemInput!]!, $locationId: ID!) {
    inventoryBulkAdjustQuantityAtLocation(inventoryItemAdjustments: $inventoryItemAdjustments, locationId: $locationId) {
      inventoryLevels {
        id
      }
      userErrors {
        field
        message
      }
    }
  }
  GRAPHQL
Custom Shopify Apps built just for you! hunkybill@gmail.com http://www.resistorsoftware.com
0 Likes