FLCordis
FLCordis

Reputation: 29

Shopify create a integration via GraphQL

So, for the past week, I've been studying Shopify integration (I just started a job to automate sales workflows). I initially built the entire integration using the REST API, receiving a JSON from the software with all the product data. However, according to Shopify's documentation, they are now using GraphQL.

For the past three days, I've been trying to set up the GraphQL workflow in N8N (using both the GraphQL node and the HTTP node for testing), but based on my tests, it has a lot of limitations.

I'm trying to create a product with various attributes (name, quantity, weight, unit, sizes, description, video, price, product ID from the software, category, etc.), but I keep running into errors. I can't create a product with stock and price because it requires a variant. When I try to create a variant, it asks me to create an option first. When I attempt to create an option with stock, I need to activate inventory management. Then, when I try to set up the inventory, I get an error saying that I need to define a default quantity, and so on.

I'm desperate and don't know what to do. Even though we're all still learning this new integration and GraphQL, giving up in the first week feels really frustrating. I need some guidance or a proper way to do this because I've already tried everything.

The ONLY thing that worked now was this Node:

mutation CreateProductWithAttributes {
  productCreate(product: {
    title: "LED Light test",
    descriptionHtml: "<p>Description on HTML</p>",
    productType: "Lights",
    vendor: "MXLED",
    tags: ["LED", "PURPLE"]
  }) {
    product {
      id
      title
      vendor
      tags
    }
    shop {
      id
    }
    userErrors {
      field
      message
    }
  }
}

But i can't place price, weight, size, unit, sku and others infos (i need price per unity, ex: 10$ for a box, or 10$ for 200ml).

Upvotes: 0

Views: 7

Answers (0)

Related Questions