Skip to content

Instantly share code, notes, and snippets.

@mshick
Last active June 22, 2023 04:23
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mshick/d1f7925e44b778117945be3b4daed0b0 to your computer and use it in GitHub Desktop.
Save mshick/d1f7925e44b778117945be3b4daed0b0 to your computer and use it in GitHub Desktop.

Fabric EComm Project

TARGET

{
  getProductDetails(input: { sku: "FUR_BED_02" }) {
    itemId
    categories {
      id
    }
    children {
      sku
      price {
        itemId
        priceListId
      }
      inventory {
        itemId
        inStock
      }
    }
    price {
      priceListId
    }
    inventory {
      itemId
      inStock
    }
    attributes {
      name
      value
      description
      type
    }
  }
}

SOURCE

{
  getShopifyProductDetails(id: "gid://shopify/Product/6633850011887") {
    id
    totalInventory
    tracksInventory
    priceRangeV2 {
      maxVariantPrice {
        amount
        currencyCode
      }
      minVariantPrice {
        amount
        currencyCode
      }
    }
    giftCardTemplateSuffix
    handle
    images(first: 10) {
      edges {
        node {
          altText
          id
          originalSrc
        }
      }
    }
    metafields(first: 10) {
      edges {
        node {
          id
          namespace
          ownerType
          value
          description
          key
        }
      }
    }
    productType
    publishedAt
    tags
    templateSuffix
    title
    variants(first: 10) {
      edges {
        node {
          id
        }
      }
    }
    vendor
    description
    metafield(namespace: "my_fields", key: "product_description") {
      id
      namespace
      ownerType
      value
    }
  }
}

Make this:

    metafields(first: 10) {
      edges {
        node {
          id
          namespace
          ownerType
          value
          description
          key
        }
      }
    }

look like this:

    attributes {
      name
      value
      description
      type
    }

Mappings

origin dest
metafields.edges[*].node.description attributes[*].description
metafields.edges[*].node.key attributes[*].name
metafields.edges[*].node.ownerType attributes[*].type
metafields.edges[*].node.value attributes[*].value

Mapping expression

map(compose(zipObject(['description', 'id', 'name', 'namespace', 'type', 'value']), map(get('[1]')), sortBy('[0]'), toPairs, get('node')), get('steps[0].data.metafields.edges'))

map(compose(map(compose(compose(zipObject(['description', 'id', 'name', 'namespace', 'type', 'value']), map(get('[1]'))), sortBy('[0]'), toPairs, get('node'))), get('metafields.edges')), get('data.getShopifyProductList.items', steps[0]))

_.map(
    _.compose(
        _.compose(
            _.zipObject(['description', 'id', 'name', 'namespace', 'type', 'value']), 
            _.map(_.get('[1]'))
        ), 
        _.sortBy('[0]'), 
        _.toPairs, 
        _.get('node')
    ),
    _.get('metafields.edges', step)
)
map(compose(compose(zipObject(['description', 'id', 'name', 'namespace', 'type', 'value']), map(get('[1]'))), sortBy('[0]'), toPairs, get('node')), get('metafields.edges', steps[1]))
{
"version": 35,
"defaultLocale": "en-us",
"projectId": "33d5a3c2-1d6b-4d3b-a899-b7a038e5c588",
"dataKey": "AQIDAHi9nATJb1LYgj5u7ShOGp43y2H6TuckRKGDlwTU4b6ryQHqGUTdpQ8jICNmIoCp/TFzAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMn99c8BNaU1KiVYtVAgEQgDsON/SmHTt7fMy66iCX+bKL9mSDTD6Wl3d3WdHgL23ow1gYxojKFkcr1aPCFTb9OK8ytdvHGaepj50h0A==",
"locales": ["en-us"],
"apiVersion": "2",
"schemaVersion": "3.6.0",
"created": "2021-08-25T00:19:30.305Z",
"updated": "2021-09-24T17:56:37.174Z",
"queries": {
"testStoreAPI": {
"description": "Returns sample response",
"args": "StoreArgs",
"shape": "StoreShape",
"resolver": {
"name": "rest:post",
"service": "store-api-hw",
"options": { "path": "/hello-world" },
"argsMapping": { "json": [["get", { "path": "args.payload" }]] }
}
},
"getCategoryTree": {
"shape": "CategoryTree",
"resolver": {
"resultsMapping": [["get", { "path": "steps[0]" }]],
"id": "category-tree",
"name": "rest:get",
"service": "copilot-layer",
"options": { "path": "/api-category/v1/category/tree" },
"searchParamsMapping": [["id", [["get", { "path": "args.id" }]]]]
},
"description": "Returns Category Tree",
"args": "CategoryTreeArgs"
},
"getProductDetails": {
"shape": "Product",
"resolver": {
"resultsMapping": {
"...": [["get", { "path": "steps[0].products[0]" }]],
"children": [["get", { "path": "steps[0].products[0].children" }]]
},
"id": "product",
"name": "rest:get",
"service": "pim",
"options": { "path": "/v1/product" },
"searchParamsMapping": [
[
"skus",
[
[
"expressionEval",
{ "expression": "'[\"' + args.input.sku + '\"]'" }
]
]
]
]
},
"description": "Returns Product Details",
"args": "ProductDetailsInput"
},
"getShopifyProductDetails": {
"shape": "fcommerce-inc:Product",
"resolver": {
"resultsMapping": {
"...": [["get", { "path": "steps[0]" }]],
"sku": [
[
"expressionEval",
{ "expression": "join('', slice(22, undefined, steps[0].id))" }
]
],
"itemId": [
[
"expressionEval",
{ "expression": "join('', slice(22, undefined, steps[0].id))" }
],
["expressionEval", { "expression": "+previousStep" }]
]
},
"id": "product",
"name": "graphql:query",
"service": "fcommerce-inc",
"options": { "fieldName": "product" },
"argsMapping": { "id": [["get", { "path": "args.id" }]] }
},
"description": "Returns Shopify Details",
"args": "ShopifyProductDetailsInput"
},
"getCartInit": {
"description": "Returns sample response",
"shape": "CartInitShape",
"resolver": {
"name": "rest:get",
"service": "cart-init",
"options": { "path": "/cart" }
}
},
"getGenericInventory": {
"description": "Returns Generic Inventory",
"args": "InventoryArgs",
"shape": "GenericInventory",
"resolver": {
"name": "rest:get",
"service": "inventory",
"options": { "path": "/inventory/generic/{itemId}?query=itemId" },
"argsMapping": {
"pathParams.itemId": [["get", { "path": "args.itemId" }]]
}
}
},
"getInventory": {
"description": "Returns Inventory",
"args": "InventoryArgs",
"shape": { "type": "array", "items": { "@ref": "local:Inventory" } },
"resolver": {
"name": "rest:post",
"service": "inventory",
"options": { "path": "/inventory" },
"argsMapping": { "json": [["get", { "path": "args.payload" }]] }
}
},
"getProducts": {
"description": "Returns Products",
"args": "ItemProductArgs",
"shape": "ItemProduct",
"resolver": {
"name": "rest:get",
"service": "pim",
"options": { "path": "/v1/product" },
"searchParamsMapping": [
["itemIds", [["get", { "path": "args.itemIds" }]]],
["size", [["get", { "path": "args.size" }]]],
["page", [["get", { "path": "args.page" }]]]
]
}
},
"getItemProductFilter": {
"description": "Returns Item Product",
"args": "ItemProductArgs",
"shape": "ItemProductFilter",
"resolver": {
"name": "rest:get",
"service": "pim",
"options": { "path": "/v1/product" },
"searchParamsMapping": [
["itemIds", [["get", { "path": "args.itemIds" }]]],
["size", [["get", { "path": "args.size" }]]],
["page", [["get", { "path": "args.page" }]]]
],
"resultsMapping": [
[
"expressionEval",
{
"expression": "update('products', map(update('attributes', compose(mapKeys(camelCase), mapValues(get('value')), keyBy('name')))))(steps[0])"
}
]
]
}
},
"getPrice": {
"description": "Returns Price",
"args": "PriceArgs",
"shape": { "type": "array", "items": { "@ref": "local:Price" } },
"resolver": {
"name": "rest:post",
"service": "price",
"options": { "path": "/offer/get-by-itemIds" },
"argsMapping": { "json": [["get", { "path": "args.payload" }]] }
}
},
"getShopifyProduct": {
"shape": "ShopifyProduct",
"resolver": {
"name": "takeshape:get",
"service": "takeshape:local",
"options": { "model": "ShopifyProduct" }
},
"description": "Get a ShopifyProduct by ID",
"args": "TSGetArgs<ShopifyProduct>"
},
"getShopifyProductList": {
"shape": "PaginatedList<ShopifyProduct>",
"resolver": {
"name": "takeshape:list",
"service": "takeshape:local",
"options": { "model": "ShopifyProduct" }
},
"description": "Returns a list ShopifyProduct in natural order.",
"args": "TSListArgs<ShopifyProduct>"
},
"getShopifyProductVariant": {
"shape": "ShopifyProductVariant",
"resolver": {
"name": "takeshape:get",
"service": "takeshape:local",
"options": { "model": "ShopifyProductVariant" }
},
"description": "Get a ShopifyProductVariant by ID",
"args": "TSGetArgs<ShopifyProductVariant>"
},
"getShopifyProductVariantList": {
"shape": "PaginatedList<ShopifyProductVariant>",
"resolver": {
"name": "takeshape:list",
"service": "takeshape:local",
"options": { "model": "ShopifyProductVariant" }
},
"description": "Returns a list ShopifyProductVariant in natural order.",
"args": "TSListArgs<ShopifyProductVariant>"
},
"getCollection": {
"shape": "Collection",
"resolver": {
"name": "takeshape:get",
"service": "takeshape:local",
"options": { "model": "Collection" }
},
"description": "Get a Collection by ID",
"args": "TSGetArgs<Collection>"
},
"getCollectionList": {
"shape": "PaginatedList<Collection>",
"resolver": {
"name": "takeshape:list",
"service": "takeshape:local",
"options": { "model": "Collection" }
},
"description": "Returns a list Collection in natural order.",
"args": "TSListArgs<Collection>"
}
},
"mutations": {
"updateShopifyProduct": {
"shape": "UpdateResult<ShopifyProduct>",
"resolver": {
"compose": [
{
"id": "createNewShopifyObject",
"if": "isEmpty(args.input.shopifyProductId) && !isEmpty(args.input.shopifyProduct)",
"argsMapping": {
"input.descriptionHtml": [
["get", { "path": "args.input.shopifyProduct.descriptionHtml" }]
],
"input.handle": [
["get", { "path": "args.input.shopifyProduct.handle" }]
],
"input.redirectNewHandle": [
[
"get",
{ "path": "args.input.shopifyProduct.redirectNewHandle" }
]
],
"input.productType": [
["get", { "path": "args.input.shopifyProduct.productType" }]
],
"input.tags": [
["get", { "path": "args.input.shopifyProduct.tags" }]
],
"input.templateSuffix": [
["get", { "path": "args.input.shopifyProduct.templateSuffix" }]
],
"input.giftCard": [
["get", { "path": "args.input.shopifyProduct.giftCard" }]
],
"input.giftCardTemplateSuffix": [
[
"get",
{ "path": "args.input.shopifyProduct.giftCardTemplateSuffix" }
]
],
"input.title": [
["get", { "path": "args.input.shopifyProduct.title" }]
],
"input.vendor": [
["get", { "path": "args.input.shopifyProduct.vendor" }]
],
"input.bodyHtml": [
["get", { "path": "args.input.shopifyProduct.bodyHtml" }]
]
},
"name": "graphql:mutation",
"service": "fcommerce-inc",
"options": {
"fieldName": "productCreate",
"selectionSet": "{ product { id } }"
}
},
{
"id": "editTakeshape",
"argsMapping": {
"input": [["get", { "path": "args.input" }]],
"input.shopifyProductId": [
["get", { "path": "steps.createNewShopifyObject.product.id" }],
["get", { "path": "args.input.shopifyProductId" }]
]
},
"name": "takeshape:update",
"service": "takeshape:local",
"options": { "model": "ShopifyProduct" }
},
{
"id": "updateExistingShopifyObject",
"if": "!isEmpty(args.input.shopifyProductId) && !isEmpty(args.input.shopifyProduct)",
"argsMapping": {
"input.descriptionHtml": [
["get", { "path": "args.input.shopifyProduct.descriptionHtml" }]
],
"input.handle": [
["get", { "path": "args.input.shopifyProduct.handle" }]
],
"input.redirectNewHandle": [
[
"get",
{ "path": "args.input.shopifyProduct.redirectNewHandle" }
]
],
"input.productType": [
["get", { "path": "args.input.shopifyProduct.productType" }]
],
"input.tags": [
["get", { "path": "args.input.shopifyProduct.tags" }]
],
"input.templateSuffix": [
["get", { "path": "args.input.shopifyProduct.templateSuffix" }]
],
"input.giftCard": [
["get", { "path": "args.input.shopifyProduct.giftCard" }]
],
"input.giftCardTemplateSuffix": [
[
"get",
{ "path": "args.input.shopifyProduct.giftCardTemplateSuffix" }
]
],
"input.title": [
["get", { "path": "args.input.shopifyProduct.title" }]
],
"input.vendor": [
["get", { "path": "args.input.shopifyProduct.vendor" }]
],
"input.bodyHtml": [
["get", { "path": "args.input.shopifyProduct.bodyHtml" }]
],
"input.id": [["get", { "path": "args.input.shopifyProductId" }]]
},
"name": "graphql:mutation",
"service": "fcommerce-inc",
"options": {
"fieldName": "productUpdate",
"selectionSet": "{ product { id } }"
}
}
],
"resultsMapping": {
"result": [["get", { "path": "steps.editTakeshape.result" }]]
}
},
"description": "Update ShopifyProduct. If the input has Shopify values and a Shopify ID, the Shopify product with that ID is updated.\nIf the input has Shopify values and no Shopify ID, a Shopify product is created.",
"args": "UpdateArgs<ShopifyProductInterface>"
},
"createShopifyProduct": {
"shape": "CreateResult<ShopifyProduct>",
"resolver": {
"compose": [
{
"id": "shopifyCreate",
"if": "!isEmpty(args.input.shopifyProduct)",
"argsMapping": {
"input.descriptionHtml": [
["get", { "path": "args.input.shopifyProduct.descriptionHtml" }]
],
"input.handle": [
["get", { "path": "args.input.shopifyProduct.handle" }]
],
"input.redirectNewHandle": [
[
"get",
{ "path": "args.input.shopifyProduct.redirectNewHandle" }
]
],
"input.productType": [
["get", { "path": "args.input.shopifyProduct.productType" }]
],
"input.tags": [
["get", { "path": "args.input.shopifyProduct.tags" }]
],
"input.templateSuffix": [
["get", { "path": "args.input.shopifyProduct.templateSuffix" }]
],
"input.giftCard": [
["get", { "path": "args.input.shopifyProduct.giftCard" }]
],
"input.giftCardTemplateSuffix": [
[
"get",
{ "path": "args.input.shopifyProduct.giftCardTemplateSuffix" }
]
],
"input.title": [
["get", { "path": "args.input.shopifyProduct.title" }]
],
"input.vendor": [
["get", { "path": "args.input.shopifyProduct.vendor" }]
],
"input.bodyHtml": [
["get", { "path": "args.input.shopifyProduct.bodyHtml" }]
]
},
"name": "graphql:mutation",
"service": "fcommerce-inc",
"options": {
"fieldName": "productCreate",
"selectionSet": "{ product { id } }"
}
},
{
"id": "creatingShopifyObject",
"if": "!isEmpty(args.input.shopifyProduct)",
"argsMapping": {
"input": [["get", { "path": "args.input" }]],
"input.shopifyProductId": [
["get", { "path": "steps.shopifyCreate.product.id" }]
]
},
"name": "takeshape:create",
"service": "takeshape:local",
"options": { "model": "ShopifyProduct" }
},
{
"id": "notCreatingShopifyObject",
"if": "isEmpty(args.input.shopifyProduct)",
"argsMapping": { "input": [["get", { "path": "args.input" }]] },
"name": "takeshape:create",
"service": "takeshape:local",
"options": { "model": "ShopifyProduct" }
}
],
"resultsMapping": {
"result": [
["get", { "path": "steps.creatingShopifyObject.result" }],
["get", { "path": "steps.notCreatingShopifyObject.result" }]
]
}
},
"description": "Create ShopifyProduct. If Shopify values are provided, a Shopify product is also created and the new product ID is saved.",
"args": "CreateArgs<ShopifyProductInterface>"
},
"duplicateShopifyProduct": {
"shape": "DuplicateResult<ShopifyProduct>",
"resolver": {
"name": "takeshape:duplicate",
"service": "takeshape:local",
"options": { "model": "ShopifyProduct" }
},
"description": "Duplicate ShopifyProduct",
"args": "DuplicateArgs<ShopifyProduct>"
},
"deleteShopifyProduct": {
"shape": "DeleteResult<ShopifyProduct>",
"resolver": {
"name": "takeshape:delete",
"service": "takeshape:local",
"options": { "model": "ShopifyProduct" }
},
"description": "Delete ShopifyProduct",
"args": "DeleteArgs<ShopifyProduct>"
},
"updateShopifyProductVariant": {
"shape": "UpdateResult<ShopifyProductVariant>",
"resolver": {
"compose": [
{
"id": "createNewShopifyObject",
"if": "isEmpty(args.input.shopifyProductVariantId) && !isEmpty(args.input.shopifyProductVariant)",
"argsMapping": {
"input.barcode": [
["get", { "path": "args.input.shopifyProductVariant.barcode" }]
],
"input.compareAtPrice": [
[
"get",
{ "path": "args.input.shopifyProductVariant.compareAtPrice" }
]
],
"input.fulfillmentServiceId": [
[
"get",
{
"path": "args.input.shopifyProductVariant.fulfillmentServiceId"
}
]
],
"input.options": [
["get", { "path": "args.input.shopifyProductVariant.options" }]
],
"input.position": [
["get", { "path": "args.input.shopifyProductVariant.position" }]
],
"input.price": [
["get", { "path": "args.input.shopifyProductVariant.price" }]
],
"input.sku": [
["get", { "path": "args.input.shopifyProductVariant.sku" }]
],
"input.taxable": [
["get", { "path": "args.input.shopifyProductVariant.taxable" }]
],
"input.taxCode": [
["get", { "path": "args.input.shopifyProductVariant.taxCode" }]
],
"input.weight": [
["get", { "path": "args.input.shopifyProductVariant.weight" }]
],
"input.weightUnit": [
[
"get",
{ "path": "args.input.shopifyProductVariant.weightUnit" }
]
]
},
"name": "graphql:mutation",
"service": "fcommerce-inc",
"options": {
"fieldName": "productVariantCreate",
"selectionSet": "{ productVariant { id } }"
}
},
{
"id": "editTakeshape",
"argsMapping": {
"input": [["get", { "path": "args.input" }]],
"input.shopifyProductVariantId": [
[
"get",
{ "path": "steps.createNewShopifyObject.productVariant.id" }
],
["get", { "path": "args.input.shopifyProductVariantId" }]
]
},
"name": "takeshape:update",
"service": "takeshape:local",
"options": { "model": "ShopifyProductVariant" }
},
{
"id": "updateExistingShopifyObject",
"if": "!isEmpty(args.input.shopifyProductVariantId) && !isEmpty(args.input.shopifyProductVariant)",
"argsMapping": {
"input.barcode": [
["get", { "path": "args.input.shopifyProductVariant.barcode" }]
],
"input.compareAtPrice": [
[
"get",
{ "path": "args.input.shopifyProductVariant.compareAtPrice" }
]
],
"input.fulfillmentServiceId": [
[
"get",
{
"path": "args.input.shopifyProductVariant.fulfillmentServiceId"
}
]
],
"input.options": [
["get", { "path": "args.input.shopifyProductVariant.options" }]
],
"input.position": [
["get", { "path": "args.input.shopifyProductVariant.position" }]
],
"input.price": [
["get", { "path": "args.input.shopifyProductVariant.price" }]
],
"input.sku": [
["get", { "path": "args.input.shopifyProductVariant.sku" }]
],
"input.taxable": [
["get", { "path": "args.input.shopifyProductVariant.taxable" }]
],
"input.taxCode": [
["get", { "path": "args.input.shopifyProductVariant.taxCode" }]
],
"input.weight": [
["get", { "path": "args.input.shopifyProductVariant.weight" }]
],
"input.weightUnit": [
[
"get",
{ "path": "args.input.shopifyProductVariant.weightUnit" }
]
],
"input.id": [
["get", { "path": "args.input.shopifyProductVariantId" }]
]
},
"name": "graphql:mutation",
"service": "fcommerce-inc",
"options": {
"fieldName": "productVariantUpdate",
"selectionSet": "{ productVariant { id } }"
}
}
],
"resultsMapping": {
"result": [["get", { "path": "steps.editTakeshape.result" }]]
}
},
"description": "Update ShopifyProductVariant. If the input has Shopify values and a Shopify ID, the Shopify productVariant with that ID is updated.\nIf the input has Shopify values and no Shopify ID, a Shopify productVariant is created.",
"args": "UpdateArgs<ShopifyProductVariantInterface>"
},
"createShopifyProductVariant": {
"shape": "CreateResult<ShopifyProductVariant>",
"resolver": {
"compose": [
{
"id": "shopifyCreate",
"if": "!isEmpty(args.input.shopifyProductVariant)",
"argsMapping": {
"input.barcode": [
["get", { "path": "args.input.shopifyProductVariant.barcode" }]
],
"input.compareAtPrice": [
[
"get",
{ "path": "args.input.shopifyProductVariant.compareAtPrice" }
]
],
"input.fulfillmentServiceId": [
[
"get",
{
"path": "args.input.shopifyProductVariant.fulfillmentServiceId"
}
]
],
"input.options": [
["get", { "path": "args.input.shopifyProductVariant.options" }]
],
"input.position": [
["get", { "path": "args.input.shopifyProductVariant.position" }]
],
"input.price": [
["get", { "path": "args.input.shopifyProductVariant.price" }]
],
"input.productId": [
[
"get",
{ "path": "args.input.shopifyProductVariant.productId" }
]
],
"input.sku": [
["get", { "path": "args.input.shopifyProductVariant.sku" }]
],
"input.taxable": [
["get", { "path": "args.input.shopifyProductVariant.taxable" }]
],
"input.taxCode": [
["get", { "path": "args.input.shopifyProductVariant.taxCode" }]
],
"input.weight": [
["get", { "path": "args.input.shopifyProductVariant.weight" }]
],
"input.weightUnit": [
[
"get",
{ "path": "args.input.shopifyProductVariant.weightUnit" }
]
]
},
"name": "graphql:mutation",
"service": "fcommerce-inc",
"options": {
"fieldName": "productVariantCreate",
"selectionSet": "{ productVariant { id } }"
}
},
{
"id": "creatingShopifyObject",
"if": "!isEmpty(args.input.shopifyProductVariant)",
"argsMapping": {
"input": [["get", { "path": "args.input" }]],
"input.shopifyProductVariantId": [
["get", { "path": "steps.shopifyCreate.productVariant.id" }]
]
},
"name": "takeshape:create",
"service": "takeshape:local",
"options": { "model": "ShopifyProductVariant" }
},
{
"id": "notCreatingShopifyObject",
"if": "isEmpty(args.input.shopifyProductVariant)",
"argsMapping": { "input": [["get", { "path": "args.input" }]] },
"name": "takeshape:create",
"service": "takeshape:local",
"options": { "model": "ShopifyProductVariant" }
}
],
"resultsMapping": {
"result": [
["get", { "path": "steps.creatingShopifyObject.result" }],
["get", { "path": "steps.notCreatingShopifyObject.result" }]
]
}
},
"description": "Create ShopifyProductVariant. If Shopify values are provided, a Shopify productVariant is also created and the new productVariant ID is saved.",
"args": "CreateArgs<ShopifyProductVariantInterface>"
},
"duplicateShopifyProductVariant": {
"shape": "DuplicateResult<ShopifyProductVariant>",
"resolver": {
"name": "takeshape:duplicate",
"service": "takeshape:local",
"options": { "model": "ShopifyProductVariant" }
},
"description": "Duplicate ShopifyProductVariant",
"args": "DuplicateArgs<ShopifyProductVariant>"
},
"deleteShopifyProductVariant": {
"shape": "DeleteResult<ShopifyProductVariant>",
"resolver": {
"name": "takeshape:delete",
"service": "takeshape:local",
"options": { "model": "ShopifyProductVariant" }
},
"description": "Delete ShopifyProductVariant",
"args": "DeleteArgs<ShopifyProductVariant>"
},
"updateCollection": {
"shape": "UpdateResult<Collection>",
"resolver": {
"compose": [
{
"id": "createNewShopifyObject",
"if": "isEmpty(args.input.shopifyCollectionId) && !isEmpty(args.input.shopifyCollection)",
"argsMapping": {
"input.descriptionHtml": [
[
"get",
{ "path": "args.input.shopifyCollection.descriptionHtml" }
]
],
"input.handle": [
["get", { "path": "args.input.shopifyCollection.handle" }]
],
"input.templateSuffix": [
[
"get",
{ "path": "args.input.shopifyCollection.templateSuffix" }
]
],
"input.sortOrder": [
["get", { "path": "args.input.shopifyCollection.sortOrder" }]
],
"input.title": [
["get", { "path": "args.input.shopifyCollection.title" }]
],
"input.redirectNewHandle": [
[
"get",
{ "path": "args.input.shopifyCollection.redirectNewHandle" }
]
]
},
"name": "graphql:mutation",
"service": "fcommerce-inc",
"options": {
"fieldName": "collectionCreate",
"selectionSet": "{ collection { id } }"
}
},
{
"id": "editTakeshape",
"argsMapping": {
"input": [["get", { "path": "args.input" }]],
"input.shopifyCollectionId": [
[
"get",
{ "path": "steps.createNewShopifyObject.collection.id" }
],
["get", { "path": "args.input.shopifyCollectionId" }]
]
},
"name": "takeshape:update",
"service": "takeshape:local",
"options": { "model": "Collection" }
},
{
"id": "updateExistingShopifyObject",
"if": "!isEmpty(args.input.shopifyCollectionId) && !isEmpty(args.input.shopifyCollection)",
"argsMapping": {
"input.descriptionHtml": [
[
"get",
{ "path": "args.input.shopifyCollection.descriptionHtml" }
]
],
"input.handle": [
["get", { "path": "args.input.shopifyCollection.handle" }]
],
"input.templateSuffix": [
[
"get",
{ "path": "args.input.shopifyCollection.templateSuffix" }
]
],
"input.sortOrder": [
["get", { "path": "args.input.shopifyCollection.sortOrder" }]
],
"input.title": [
["get", { "path": "args.input.shopifyCollection.title" }]
],
"input.redirectNewHandle": [
[
"get",
{ "path": "args.input.shopifyCollection.redirectNewHandle" }
]
],
"input.id": [
["get", { "path": "args.input.shopifyCollectionId" }]
]
},
"name": "graphql:mutation",
"service": "fcommerce-inc",
"options": {
"fieldName": "collectionUpdate",
"selectionSet": "{ collection { id } }"
}
}
],
"resultsMapping": {
"result": [["get", { "path": "steps.editTakeshape.result" }]]
}
},
"description": "Update Collection. If the input has Shopify values and a Shopify ID, the Shopify collection with that ID is updated.\nIf the input has Shopify values and no Shopify ID, a Shopify collection is created.",
"args": "UpdateArgs<CollectionInterface>"
},
"createCollection": {
"shape": "CreateResult<Collection>",
"resolver": {
"compose": [
{
"id": "shopifyCreate",
"if": "!isEmpty(args.input.shopifyCollection)",
"argsMapping": {
"input.descriptionHtml": [
[
"get",
{ "path": "args.input.shopifyCollection.descriptionHtml" }
]
],
"input.handle": [
["get", { "path": "args.input.shopifyCollection.handle" }]
],
"input.templateSuffix": [
[
"get",
{ "path": "args.input.shopifyCollection.templateSuffix" }
]
],
"input.sortOrder": [
["get", { "path": "args.input.shopifyCollection.sortOrder" }]
],
"input.title": [
["get", { "path": "args.input.shopifyCollection.title" }]
],
"input.redirectNewHandle": [
[
"get",
{ "path": "args.input.shopifyCollection.redirectNewHandle" }
]
]
},
"name": "graphql:mutation",
"service": "fcommerce-inc",
"options": {
"fieldName": "collectionCreate",
"selectionSet": "{ collection { id } }"
}
},
{
"id": "creatingShopifyObject",
"if": "!isEmpty(args.input.shopifyCollection)",
"argsMapping": {
"input": [["get", { "path": "args.input" }]],
"input.shopifyCollectionId": [
["get", { "path": "steps.shopifyCreate.collection.id" }]
]
},
"name": "takeshape:create",
"service": "takeshape:local",
"options": { "model": "Collection" }
},
{
"id": "notCreatingShopifyObject",
"if": "isEmpty(args.input.shopifyCollection)",
"argsMapping": { "input": [["get", { "path": "args.input" }]] },
"name": "takeshape:create",
"service": "takeshape:local",
"options": { "model": "Collection" }
}
],
"resultsMapping": {
"result": [
["get", { "path": "steps.creatingShopifyObject.result" }],
["get", { "path": "steps.notCreatingShopifyObject.result" }]
]
}
},
"description": "Create Collection. If Shopify values are provided, a Shopify collection is also created and the new collection ID is saved.",
"args": "CreateArgs<CollectionInterface>"
},
"duplicateCollection": {
"shape": "DuplicateResult<Collection>",
"resolver": {
"name": "takeshape:duplicate",
"service": "takeshape:local",
"options": { "model": "Collection" }
},
"description": "Duplicate Collection",
"args": "DuplicateArgs<Collection>"
},
"deleteCollection": {
"shape": "DeleteResult<Collection>",
"resolver": {
"name": "takeshape:delete",
"service": "takeshape:local",
"options": { "model": "Collection" }
},
"description": "Delete Collection",
"args": "DeleteArgs<Collection>"
}
},
"shapes": {
"SProduct": {
"id": "SProduct",
"name": "SProduct",
"title": "SProduct",
"schema": {
"type": "object",
"properties": {
"sku": { "type": "string" },
"type": { "type": "string" },
"status": { "type": "string" },
"createdOn": { "type": "string" }
}
}
},
"Product": {
"id": "Product",
"name": "Product",
"title": "Product",
"schema": {
"type": "object",
"properties": {
"itemId": { "type": "string", "title": "itemId" },
"sku": { "type": "string" },
"children": {
"items": { "$ref": "#/shapes/Children/schema" },
"type": "array"
},
"description": { "type": "string" },
"type": { "type": "string" },
"status": { "type": "string" },
"bundleItems": { "type": "array" },
"categories": {
"items": { "$ref": "#/shapes/Categories/schema" },
"type": "array"
},
"attributes": {
"items": { "$ref": "#/shapes/ProductAttributes/schema" },
"type": "array"
},
"createdOn": { "type": "string" },
"modifiedOn": { "type": "string" },
"price": {
"$ref": "#/shapes/ModifiedPrice/schema",
"type": "object",
"title": "Price",
"description": "Returns Price",
"@resolver": {
"resultsMapping": {
"itemId": [["get", { "path": "steps[0][0].itemId" }]],
"base": [
["get", { "path": "steps[0][0].offers[0].price.base" }]
],
"sale": [
["get", { "path": "steps[0][0].offers[0].price.sale" }]
],
"cost": [
["get", { "path": "steps[0][0].offers[0].price.cost" }]
],
"currency": [
["get", { "path": "steps[0][0].offers[0].price.currency" }]
],
"priceListId": [["get", { "path": "steps[0][0].priceListId" }]]
},
"name": "rest:post",
"service": "price",
"options": { "path": "/offer/get-by-itemIds" },
"argsMapping": {
"body": [
[
"expressionEval",
{ "expression": "'{\"itemIds\":[' + source.itemId +']}'" }
]
]
}
}
},
"inventory": {
"$ref": "#/shapes/Inventory/schema",
"type": "object",
"title": "Inventory",
"description": "Returns Inventory",
"@resolver": {
"resultsMapping": [["get", { "path": "steps[0][0]" }]],
"name": "rest:post",
"service": "inventory",
"options": { "path": "/inventory" },
"argsMapping": {
"body": [
[
"expressionEval",
{
"expression": "'{\"items\":[{ \"itemId\":' + source.itemId + ', \"quantity\": 1}], \"channelId\": 12 }'"
}
]
]
}
}
}
}
}
},
"CategoryTree": {
"id": "CategoryTree",
"name": "CategoryTree",
"title": "CategoryTree",
"schema": {
"type": "object",
"properties": {
"id": { "type": "string" },
"name": { "type": "string" }
}
}
},
"ProductDetailsInput": {
"id": "ProductDetailsInput",
"name": "ProductDetailsInput",
"title": "ProductDetailsInput",
"schema": {
"type": "object",
"properties": {
"input": {
"type": "object",
"properties": { "sku": { "type": "string" } }
}
},
"required": ["input"]
}
},
"ShopifyProductDetailsInput": {
"id": "ShopifyProductDetailsInput",
"name": "ShopifyProductDetailsInput",
"title": "ShopifyProductDetailsInput",
"schema": {
"type": "object",
"properties": { "id": { "type": "string" } },
"required": ["id"]
}
},
"CategoryTreeArgs": {
"id": "CategoryTreeArgs",
"name": "CategoryTreeArgs",
"title": "CategoryTreeArgs",
"schema": {
"type": "object",
"properties": { "id": { "type": "string" } },
"required": ["id"]
}
},
"InventoryArgs": {
"id": "inventory-args-id",
"name": "InventoryArgs",
"title": "InventoryArgs",
"schema": {
"type": "object",
"properties": {
"itemId": { "type": "string", "title": "Items Id" },
"payload": { "type": "object" }
}
}
},
"PriceArgs": {
"id": "price-args-id",
"name": "PriceArgs",
"title": "PriceArgs",
"schema": {
"type": "object",
"properties": { "payload": { "type": "object" } }
}
},
"ItemProductArgs": {
"id": "item-args-id",
"name": "ItemProductArgs",
"title": "ItemProductArgs",
"schema": {
"type": "object",
"properties": {
"itemIds": { "type": "string", "title": "Items Ids" },
"page": { "type": "string", "title": "Page" },
"size": { "type": "string", "title": "size" }
}
}
},
"ItemProduct": {
"id": "item-id",
"name": "ItemProduct",
"title": "ItemProduct",
"schema": {
"type": "object",
"properties": {
"pageSize": { "type": "number" },
"totalSize": { "type": "number" },
"pages": { "type": "number" },
"products": {
"items": { "$ref": "#/shapes/IProducts/schema" },
"type": "array"
}
}
}
},
"ItemProductFilter": {
"id": "item-filter-id",
"name": "ItemProductFilter",
"title": "ItemProductFilter",
"schema": {
"type": "object",
"properties": {
"pageSize": { "type": "number" },
"totalSize": { "type": "number" },
"pages": { "type": "number" },
"products": {
"items": { "$ref": "#/shapes/IProductsFilter/schema" },
"type": "array"
}
}
}
},
"IProducts": {
"id": "product-id",
"name": "IProducts",
"title": "IProducts",
"schema": {
"type": "object",
"properties": {
"sku": { "type": "string" },
"itemId": { "type": "number" },
"children": {
"items": { "$ref": "#/shapes/Children/schema" },
"type": "array"
},
"type": { "type": "string" },
"status": { "type": "string" },
"bundleItems": { "type": "array" },
"categories": {
"items": { "$ref": "#/shapes/Categories/schema" },
"type": "array"
},
"attributes": {
"items": { "$ref": "#/shapes/ProductAttributes/schema" },
"type": "array"
},
"createdOn": { "type": "string" },
"modifiedOn": { "type": "string" }
}
}
},
"IProductsFilter": {
"id": "product-filter-id",
"name": "IProductsFilter",
"title": "IProductsFilter",
"schema": {
"type": "object",
"properties": {
"sku": { "type": "string" },
"itemId": { "type": "number" },
"children": {
"items": { "$ref": "#/shapes/Children/schema" },
"type": "array"
},
"type": { "type": "string" },
"status": { "type": "string" },
"bundleItems": { "type": "array" },
"categories": {
"items": { "$ref": "#/shapes/Categories/schema" },
"type": "array"
},
"attributes": { "$ref": "#/shapes/ProductAttributesFilter/schema" },
"createdOn": { "type": "string" },
"modifiedOn": { "type": "string" }
}
}
},
"Children": {
"id": "children-id",
"name": "Children",
"title": "Children",
"schema": {
"type": "object",
"properties": {
"sku": { "type": "string" },
"attributes": {
"items": { "$ref": "#/shapes/ProductAttributes/schema" },
"type": "array"
},
"price": {
"$ref": "#/shapes/ModifiedPrice/schema",
"type": "object",
"title": "Price",
"description": "Returns Price",
"@resolver": {
"resultsMapping": {
"itemId": [["get", { "path": "steps[0][0].itemId" }]],
"base": [
["get", { "path": "steps[0][0].offers[0].price.base" }]
],
"sale": [
["get", { "path": "steps[0][0].offers[0].price.sale" }]
],
"cost": [
["get", { "path": "steps[0][0].offers[0].price.cost" }]
],
"currency": [
["get", { "path": "steps[0][0].offers[0].price.currency" }]
],
"priceListId": [["get", { "path": "steps[0][0].priceListId" }]]
},
"name": "rest:post",
"service": "price",
"options": { "path": "/offer/get-by-itemIds" },
"argsMapping": {
"body": [
[
"expressionEval",
{ "expression": "'{\"itemIds\":[' + source.itemId +']}'" }
]
]
}
}
},
"inventory": {
"$ref": "#/shapes/Inventory/schema",
"type": "object",
"title": "Inventory",
"description": "Returns Inventory",
"@resolver": {
"resultsMapping": [["get", { "path": "steps[0][0]" }]],
"name": "rest:post",
"service": "inventory",
"options": { "path": "/inventory" },
"argsMapping": {
"body": [
[
"expressionEval",
{
"expression": "'{\"items\":[{ \"itemId\":' + source.itemId + ', \"quantity\": 1}], \"channelId\": 12 }'"
}
]
]
}
}
}
}
}
},
"Categories": {
"id": "categories-id",
"name": "Categories",
"title": "Categories",
"schema": {
"type": "object",
"properties": {
"id": { "type": "string" },
"name": { "type": "string" },
"breadcrumbs": {
"items": { "$ref": "#/shapes/Breadcrumbs/schema" },
"type": "array"
},
"attributes": { "type": "array" }
}
}
},
"Breadcrumbs": {
"id": "breadcrumb-id",
"name": "Breadcrumbs",
"title": "Breadcrumbs",
"schema": {
"type": "object",
"properties": {
"id": { "type": "string" },
"name": { "type": "string" },
"attributes": { "type": "array" }
}
}
},
"ProductAttributes": {
"id": "attribute-id",
"name": "ProductAttributes",
"title": "ProductAttributes",
"schema": {
"type": "object",
"properties": {
"name": { "type": "string" },
"description": { "type": "string" },
"type": { "type": "string" },
"value": { "type": "string" }
}
}
},
"ProductAttributesFilter": {
"id": "attribute-filter-id",
"name": "ProductAttributesFilter",
"title": "ProductAttributesFilter",
"schema": {
"type": "object",
"properties": {
"productTitle": { "type": "string" },
"productImage": { "type": "string" },
"active": { "type": "string" },
"shortDescription": { "type": "string" },
"finalSale": { "type": "string" },
"length": { "type": "string" },
"weight": { "type": "string" },
"productIdNew": { "type": "string" },
"starch": { "type": "string" },
"createdDate1": { "type": "string" },
"starchAttribute": { "type": "string" },
"protein": { "type": "string" },
"productVariant": { "type": "string" },
"text2": { "type": "string" },
"textTesting": { "type": "string" },
"lov": { "type": "string" },
"color": { "type": "string" },
"test1": { "type": "string" },
"brand1": { "type": "string" },
"brand": { "type": "string" },
"size": { "type": "string" },
"description": { "type": "string" },
"sizeNumeric": { "type": "string" },
"taxCode": { "type": "string" },
"test22": { "type": "string" }
}
}
},
"GenericInventory": {
"id": "generic-inventory-id",
"name": "GenericInventory",
"title": "GenericInventory",
"schema": {
"type": "object",
"properties": {
"_id": { "type": "string" },
"itemId": { "type": "number" },
"inlocations": {
"items": { "$ref": "#/shapes/InLocations/schema" },
"type": "array"
},
"createdAt": { "type": "string" },
"updatedAt": { "type": "string" }
}
}
},
"InLocations": {
"id": "inlocations-id",
"name": "InLocations",
"title": "InLocations",
"schema": {
"type": "object",
"properties": {
"_id": { "type": "string" },
"location": {
"type": "array",
"items": { "$ref": "#/shapes/Location/schema" }
},
"inStock": { "type": "number" },
"channel": {
"type": "array",
"items": { "$ref": "#/shapes/Channel/schema" }
},
"inTransit": { "type": "array" },
"id": { "type": "string" }
}
}
},
"Location": {
"id": "location-id",
"name": "Location",
"title": "Location",
"schema": {
"type": "object",
"properties": {
"_id": { "type": "string" },
"channel": { "type": "array" },
"isActive": { "type": "string" },
"name": { "type": "string" },
"address": { "$ref": "#/shapes/Address/schema" },
"kind": { "type": "string" },
"locationId": { "type": "number" },
"pickup": { "type": "string" },
"createdAt": { "type": "string" },
"updatedAt": { "type": "string" },
"type": { "type": "string" },
"coordinates": { "$ref": "#/shapes/Coordinates/schema" }
}
}
},
"Address": {
"id": "address-id",
"name": "Address",
"title": "Address",
"schema": {
"type": "object",
"properties": {
"street1": { "type": "string" },
"city": { "type": "string" },
"state": { "type": "string" },
"country": { "type": "string" },
"zipCode": { "type": "string" }
}
}
},
"Coordinates": {
"id": "coordinates-id",
"name": "Coordinates",
"title": "Coordinates",
"schema": {
"type": "object",
"properties": {
"latitude": { "type": "number" },
"longitude": { "type": "number" }
}
}
},
"Channel": {
"id": "channel-id",
"name": "Channel",
"title": "Channel",
"schema": {
"type": "object",
"properties": {
"quantityReserved": { "type": "number" },
"_id": { "type": "string" },
"channelId": { "type": "number" },
"allocation": { "$ref": "#/shapes/Allocation/schema" },
"id": { "type": "string" }
}
}
},
"Allocation": {
"id": "allocation-id",
"name": "Allocation",
"title": "Allocation",
"schema": {
"type": "object",
"properties": {
"mou": { "type": "string" },
"unit": { "type": "number" }
}
}
},
"Inventory": {
"id": "inventory-id",
"name": "Inventory",
"title": "Inventory",
"schema": {
"type": "object",
"properties": {
"itemId": { "type": "number" },
"quantityRequested": { "type": "number" },
"stockDate": { "type": "string" },
"inStock": { "type": "boolean" },
"fromStockQuantity": { "type": "number" },
"fromStock": {
"items": { "$ref": "#/shapes/FromStock/schema" },
"type": "array"
},
"fromTransitQuantity": { "type": "number" },
"fromTransit": { "type": "array" },
"availableStockQuantity": { "type": "number" },
"availableTransitQuantity": { "type": "number" },
"availableTotal": { "type": "number" }
}
}
},
"FromStock": {
"id": "stock-id",
"name": "FromStock",
"title": "FromStock",
"schema": {
"type": "object",
"properties": {
"locationId": { "type": "string" },
"quantityReserved": { "type": "number" },
"quantityAllocated": { "type": "number" },
"stockRemaining": { "type": "number" },
"stockRequest": { "type": "number" },
"channelId": { "type": "number" }
}
}
},
"Price": {
"id": "price-id",
"name": "Price",
"title": "Price",
"schema": {
"type": "object",
"properties": {
"_id": { "type": "string" },
"isSoftDeleted": { "type": "string" },
"priceListId": { "type": "number" },
"itemId": { "type": "number" },
"offers": {
"items": { "$ref": "#/shapes/Offers/schema" },
"type": "array"
}
}
}
},
"ModifiedPrice": {
"id": "price",
"name": "ModifiedPrice",
"title": "Modified Price",
"schema": {
"type": "object",
"properties": {
"itemId": { "type": "number" },
"sale": { "type": "number" },
"cost": { "type": "number" },
"base": { "type": "number" },
"currency": { "type": "string" },
"priceListId": { "type": "number" }
}
}
},
"Offers": {
"id": "offer-id",
"name": "Offers",
"title": "Offers",
"schema": {
"type": "object",
"properties": {
"price": {
"items": { "$ref": "#/shapes/OfferPrice/schema" },
"type": "array"
},
"_id": { "type": "string" },
"kind": { "type": "string" },
"startDate": { "type": "string" },
"endDate": { "type": "string" },
"offerCode": { "type": "number" }
}
}
},
"OfferPrice": {
"id": "offer-price-id",
"name": "OfferPrice",
"title": "OfferPrice",
"schema": {
"type": "object",
"properties": {
"sale": { "type": "number" },
"cost": { "type": "number" },
"base": { "type": "number" },
"currency": { "type": "string" }
}
}
},
"CartInitArgs": {
"id": "cart-init",
"name": "CartInitArgs",
"title": "Input for cart init api",
"schema": {
"type": "object",
"properties": {
"payload": { "type": "object", "title": "parameter for cart api" }
}
}
},
"CartInitShape": {
"id": "cart-init-id",
"name": "CartInitShape",
"title": "some shape for cart",
"schema": {
"type": "object",
"properties": {
"message": { "type": "string", "title": "output string" }
}
}
},
"StoreArgs": {
"id": "store-id",
"name": "StoreArgs",
"title": "Input for store api",
"schema": {
"type": "object",
"properties": {
"payload": {
"type": "object",
"title": "name parameter for store api"
}
}
}
},
"StoreShape": {
"id": "store-shape-id",
"name": "StoreShape",
"title": "StoreShapeId",
"schema": {
"type": "object",
"properties": {
"message": { "type": "string", "title": "Message output" }
}
}
},
"ShopifyProductInterface": {
"id": "ShopifyProductInterface",
"name": "ShopifyProductInterface",
"title": "ShopifyProductInterface",
"description": "ShopifyProductInterface",
"schema": {
"type": "object",
"properties": {
"_id": { "type": "string" },
"_version": { "type": "number" },
"_status": { "type": "string", "@workflow": "default" },
"name": {
"title": "Name",
"type": "string",
"description": "Initialized with title from shopify"
},
"shopifyProductId": { "title": "Service ID", "type": "string" },
"shopifyProduct": { "@ref": "fcommerce-inc:ProductInput" }
},
"required": []
}
},
"ShopifyProduct": {
"name": "ShopifyProduct",
"id": "3f10O9dci",
"title": "ShopifyProduct",
"workflow": "default",
"model": { "type": "multiple" },
"schema": {
"type": "object",
"properties": {
"name": {
"title": "Name",
"type": "string",
"description": "Initialized with title from shopify",
"@mapping": "takeshape:local:ShopifyProduct.i-PG9JakbQ"
},
"shopifyProduct": {
"@ref": "fcommerce-inc:Product",
"@resolver": {
"name": "graphql:query",
"service": "fcommerce-inc",
"options": { "fieldName": "product" },
"argsMapping": {
"id": [["get", { "path": "source.shopifyProductId" }]]
}
},
"@tag": "pattern:service-object:1"
},
"price": {
"$ref": "#/shapes/ModifiedPrice/schema",
"type": "object",
"title": "Price",
"description": "Returns Price",
"@resolver": {
"resultsMapping": {
"itemId": [["get", { "path": "steps[0][0].itemId" }]],
"base": [
["get", { "path": "steps[0][0].offers[0].price.base" }]
],
"sale": [
["get", { "path": "steps[0][0].offers[0].price.sale" }]
],
"cost": [
["get", { "path": "steps[0][0].offers[0].price.cost" }]
],
"currency": [
["get", { "path": "steps[0][0].offers[0].price.currency" }]
],
"priceListId": [["get", { "path": "steps[0][0].priceListId" }]]
},
"name": "rest:post",
"service": "price",
"options": { "path": "/offer/get-by-itemIds" },
"argsMapping": {
"body": [
[
"expressionEval",
{ "expression": "'{\"itemIds\":[' + source.itemId +']}'" }
]
]
}
}
},
"attributes": {
"items": { "$ref": "#/shapes/ProductAttributes/schema" },
"type": "array",
"@resolver": {
"resultsMapping": [
[
"expressionEval",
{
"expression": "map(compose(compose(zipObject(['description', 'id', 'name', 'namespace', 'type', 'value']), map(get('[1]'))), sortBy('[0]'), toPairs, get('node')), get('metafields.edges', steps[0]))"
}
]
],
"name": "graphql:query",
"service": "fcommerce-inc",
"options": {
"fieldName": "product",
"selectionSet": "{ metafields(first: 10) { edges { node { id namespace ownerType value description key } } } }"
},
"argsMapping": {
"id": [["get", { "path": "source.shopifyProductId" }]]
}
}
},
"shopifyProductId": {
"type": "string",
"@mapping": "takeshape:local:ShopifyProduct.shopifyProductId",
"title": "shopify product",
"minLength": 1
}
}
}
},
"ShopifyProductVariantInterface": {
"id": "ShopifyProductVariantInterface",
"name": "ShopifyProductVariantInterface",
"title": "ShopifyProductVariantInterface",
"description": "ShopifyProductVariantInterface",
"schema": {
"type": "object",
"properties": {
"_id": { "type": "string" },
"_version": { "type": "number" },
"_status": { "type": "string", "@workflow": "default" },
"name": {
"title": "Name",
"type": "string",
"description": "Initialized with title from shopify"
},
"shopifyProductVariantId": {
"title": "Service ID",
"type": "string"
},
"shopifyProductVariant": {
"@ref": "fcommerce-inc:ProductVariantInput"
}
},
"required": []
}
},
"ShopifyProductVariant": {
"name": "ShopifyProductVariant",
"id": "bEc6HS-J5",
"title": "ShopifyProductVariant",
"workflow": "default",
"model": { "type": "multiple" },
"schema": {
"type": "object",
"properties": {
"name": {
"title": "Name",
"type": "string",
"description": "Initialized with title from shopify",
"@mapping": "takeshape:local:ShopifyProductVariant.RKrQzN70rV"
},
"shopifyProductVariant": {
"@ref": "fcommerce-inc:ProductVariant",
"@resolver": {
"name": "graphql:query",
"service": "fcommerce-inc",
"options": { "fieldName": "productVariant" },
"argsMapping": {
"id": [["get", { "path": "source.shopifyProductVariantId" }]]
}
},
"@tag": "pattern:service-object:1"
},
"shopifyProductVariantId": {
"type": "string",
"@mapping": "takeshape:local:ShopifyProductVariant.shopifyProductVariantId",
"title": "shopify productVariant",
"minLength": 1,
"pattern": "(^gid://shopify/ProductVariant/\\d+$)"
}
}
}
},
"CollectionInterface": {
"id": "CollectionInterface",
"name": "CollectionInterface",
"title": "CollectionInterface",
"description": "CollectionInterface",
"schema": {
"type": "object",
"properties": {
"_id": { "type": "string" },
"_version": { "type": "number" },
"_status": { "type": "string", "@workflow": "default" },
"name": {
"title": "Name",
"type": "string",
"description": "Initialized with title from shopify"
},
"shopifyCollectionId": { "title": "Service ID", "type": "string" },
"shopifyCollection": { "@ref": "fcommerce-inc:CollectionInput" }
},
"required": []
}
},
"Collection": {
"name": "Collection",
"id": "l6V1in_hM",
"title": "Collection",
"workflow": "default",
"model": { "type": "multiple" },
"schema": {
"type": "object",
"properties": {
"name": {
"title": "Name",
"type": "string",
"description": "Initialized with title from shopify",
"@mapping": "takeshape:local:Collection.stK4JweBbc"
},
"shopifyCollection": {
"@ref": "fcommerce-inc:Collection",
"@resolver": {
"name": "graphql:query",
"service": "fcommerce-inc",
"options": { "fieldName": "collection" },
"argsMapping": {
"id": [["get", { "path": "source.shopifyCollectionId" }]]
}
},
"@tag": "pattern:service-object:1"
},
"shopifyCollectionId": {
"type": "string",
"@mapping": "takeshape:local:Collection.shopifyCollectionId",
"title": "shopify collection",
"minLength": 1,
"pattern": "(^gid://shopify/Collection/\\d+$)"
}
}
}
},
"Shopify_Product": {
"name": "Shopify_Product",
"title": "Shopify_Product",
"id": "Shopify_Product",
"description": "The Product resource lets you manage products in a merchant’s store. You can use [ProductVariants](https://shopify.dev/docs/admin-api/graphql/reference/products-and-collections/productvariant)\nto create or update different versions of the same product. You can also add or update product [Media](https://shopify.dev/docs/admin-api/graphql/reference/products-and-collections/media).\nProducts can be organized by grouping them into a [Collection](https://shopify.dev/docs/admin-api/graphql/reference/products-and-collections/collection).",
"schema": {
"type": "object",
"properties": {
"price": {
"$ref": "#/shapes/ModifiedPrice/schema",
"type": "object",
"title": "Price",
"description": "Returns Price",
"@resolver": {
"resultsMapping": {
"itemId": [["get", { "path": "steps[0][0].itemId" }]],
"base": [
["get", { "path": "steps[0][0].offers[0].price.base" }]
],
"sale": [
["get", { "path": "steps[0][0].offers[0].price.sale" }]
],
"cost": [
["get", { "path": "steps[0][0].offers[0].price.cost" }]
],
"currency": [
["get", { "path": "steps[0][0].offers[0].price.currency" }]
],
"priceListId": [["get", { "path": "steps[0][0].priceListId" }]]
},
"name": "rest:post",
"service": "price",
"options": { "path": "/offer/get-by-itemIds" },
"argsMapping": {
"body": [
[
"expressionEval",
{ "expression": "'{\"itemIds\":[' + source.itemId +']}'" }
]
]
}
}
},
"inventory": {
"$ref": "#/shapes/Inventory/schema",
"type": "object",
"title": "Inventory",
"description": "Returns Inventory",
"@resolver": {
"resultsMapping": [["get", { "path": "steps[0][0]" }]],
"name": "rest:post",
"service": "inventory",
"options": { "path": "/inventory" },
"argsMapping": {
"body": [
[
"expressionEval",
{
"expression": "'{\"items\":[{ \"itemId\":' + source.itemId + ', \"quantity\": 1}], \"channelId\": 12 }'"
}
]
]
}
}
},
"attributes": {
"items": { "$ref": "#/shapes/ProductAttributes/schema" },
"type": "array",
"@resolver": {
"resultsMapping": [
[
"expressionEval",
{
"expression": "map(compose(compose(zipObject(['description', 'id', 'name', 'namespace', 'type', 'value']), map(get('[1]'))), sortBy('[0]'), toPairs, get('node')), get('metafields.edges', steps[0]))"
}
]
],
"name": "graphql:query",
"service": "fcommerce-inc",
"options": {
"fieldName": "product",
"selectionSet": "{ metafields(first: 10) { edges { node { id namespace ownerType value description key } } } }"
},
"argsMapping": { "id": [["get", { "path": "source.id" }]] }
}
},
"availablePublicationCount": {
"type": "integer",
"@mapping": "fcommerce-inc:Product.availablePublicationCount",
"description": "The number of publications a resource is published to without feedback errors."
},
"bodyHtml": {
"type": "string",
"@mapping": "fcommerce-inc:Product.bodyHtml",
"@deprecationReason": "Use `descriptionHtml` instead",
"description": "The description of the product, complete with HTML formatting."
},
"collections": {
"@ref": "fcommerce-inc:CollectionConnection",
"@mapping": "fcommerce-inc:Product.collections",
"@args": {
"type": "object",
"properties": {
"first": {
"type": "integer",
"description": "Returns up to the first `n` elements from the list."
},
"after": {
"type": "string",
"description": "Returns the elements that come after the specified cursor."
},
"last": {
"type": "integer",
"description": "Returns up to the last `n` elements from the list."
},
"before": {
"type": "string",
"description": "Returns the elements that come before the specified cursor."
},
"reverse": {
"type": "boolean",
"description": "Reverse the order of the underlying list.",
"default": false
},
"sortKey": {
"description": "Sort the underlying list by the given key.",
"enum": ["TITLE", "UPDATED_AT", "ID", "RELEVANCE"],
"default": "ID"
},
"query": {
"type": "string",
"description": "Supported filter parameters:\n - `collection_type`\n - `publishable_status`\n - `published_status`\n - `title`\n - `updated_at`\n\nSee the detailed [search syntax](https://help.shopify.com/api/getting-started/search-syntax)\nfor more information about using filters."
}
}
},
"description": "A list of the collections that include the product."
},
"createdAt": {
"description": "The date and time ([ISO 8601 format](http://en.wikipedia.org/wiki/ISO_8601)) when the product was created.",
"@tag": "DateTime",
"@mapping": "fcommerce-inc:Product.createdAt"
},
"defaultCursor": {
"type": "string",
"@mapping": "fcommerce-inc:Product.defaultCursor",
"description": "A default cursor that returns the single next record, sorted ascending by ID."
},
"description": {
"type": "string",
"@mapping": "fcommerce-inc:Product.description",
"@args": {
"type": "object",
"properties": {
"truncateAt": {
"type": "integer",
"description": "Truncates string after the given length."
}
}
},
"description": "A stripped description of the product, single line with HTML tags removed."
},
"descriptionHtml": {
"description": "The description of the product, complete with HTML formatting.",
"@tag": "HTML",
"@mapping": "fcommerce-inc:Product.descriptionHtml"
},
"descriptionPlainSummary": {
"type": "string",
"@mapping": "fcommerce-inc:Product.descriptionPlainSummary",
"@deprecationReason": "Use `description` instead",
"description": "Stripped description of the product, single line with HTML tags removed.\nTruncated to 60 characters."
},
"featuredImage": {
"@ref": "fcommerce-inc:Image",
"@mapping": "fcommerce-inc:Product.featuredImage",
"description": "The featured image for the product."
},
"featuredMedia": {
"@ref": "fcommerce-inc:Media",
"@mapping": "fcommerce-inc:Product.featuredMedia",
"description": "The featured media for the product."
},
"feedback": {
"@ref": "fcommerce-inc:ResourceFeedback",
"@mapping": "fcommerce-inc:Product.feedback",
"description": "Information about the product that's provided through resource feedback."
},
"giftCardTemplateSuffix": {
"type": "string",
"@mapping": "fcommerce-inc:Product.giftCardTemplateSuffix",
"description": "The theme template used when viewing the gift card in a store."
},
"handle": {
"type": "string",
"@mapping": "fcommerce-inc:Product.handle",
"description": "A unique human-friendly string of the product's title."
},
"hasOnlyDefaultVariant": {
"type": "boolean",
"@mapping": "fcommerce-inc:Product.hasOnlyDefaultVariant",
"description": "Whether the product has only a single variant with the default option and value."
},
"hasOutOfStockVariants": {
"type": "boolean",
"@mapping": "fcommerce-inc:Product.hasOutOfStockVariants",
"description": "Whether the product has out of stock variants."
},
"id": {
"type": "string",
"@tag": "id",
"@mapping": "fcommerce-inc:Product.id",
"description": "A globally-unique identifier."
},
"sku": {
"type": "string",
"@tag": "id",
"@mapping": "fcommerce-inc:Product.id",
"description": "sku"
},
"itemId": { "type": "number", "description": "Product Item ID" },
"images": {
"@ref": "fcommerce-inc:ImageConnection",
"@mapping": "fcommerce-inc:Product.images",
"@args": {
"type": "object",
"properties": {
"first": {
"type": "integer",
"description": "Returns up to the first `n` elements from the list."
},
"after": {
"type": "string",
"description": "Returns the elements that come after the specified cursor."
},
"last": {
"type": "integer",
"description": "Returns up to the last `n` elements from the list."
},
"before": {
"type": "string",
"description": "Returns the elements that come before the specified cursor."
},
"reverse": {
"type": "boolean",
"description": "Reverse the order of the underlying list.",
"default": false
},
"sortKey": {
"description": "Sort the underlying list by the given key.",
"enum": ["CREATED_AT", "POSITION", "ID", "RELEVANCE"],
"default": "POSITION"
},
"maxWidth": {
"type": "integer",
"description": "Image width in pixels between 1 and 2048. This argument is deprecated: Use `maxWidth` on `Image.transformedSrc` instead."
},
"maxHeight": {
"type": "integer",
"description": "Image height in pixels between 1 and 2048. This argument is deprecated: Use\n`maxHeight` on `Image.transformedSrc` instead."
},
"crop": {
"description": "Crops the image according to the specified region. This argument is\ndeprecated: Use `crop` on `Image.transformedSrc` instead.",
"enum": ["CENTER", "TOP", "BOTTOM", "LEFT", "RIGHT"]
},
"scale": {
"type": "integer",
"description": "Image size multiplier for high-resolution retina displays. Must be between 1\nand 3. This argument is deprecated: Use `scale` on `Image.transformedSrc` instead.",
"default": "1"
}
}
},
"description": "The images associated with the product."
},
"inCollection": {
"type": "boolean",
"@mapping": "fcommerce-inc:Product.inCollection",
"@args": {
"type": "object",
"properties": {
"id": {
"type": "string",
"@tag": "id",
"description": "The ID of the collection to check."
}
},
"required": ["id"]
},
"description": "Whether the product is in a given collection."
},
"isGiftCard": {
"type": "boolean",
"@mapping": "fcommerce-inc:Product.isGiftCard",
"description": "Whether the product is a gift card."
},
"legacyResourceId": {
"description": "The ID of the corresponding resource in the REST Admin API.",
"@tag": "UnsignedInt64",
"@mapping": "fcommerce-inc:Product.legacyResourceId"
},
"media": {
"@ref": "fcommerce-inc:MediaConnection",
"@mapping": "fcommerce-inc:Product.media",
"@args": {
"type": "object",
"properties": {
"first": {
"type": "integer",
"description": "Returns up to the first `n` elements from the list."
},
"after": {
"type": "string",
"description": "Returns the elements that come after the specified cursor."
},
"last": {
"type": "integer",
"description": "Returns up to the last `n` elements from the list."
},
"before": {
"type": "string",
"description": "Returns the elements that come before the specified cursor."
},
"reverse": {
"type": "boolean",
"description": "Reverse the order of the underlying list.",
"default": false
},
"sortKey": {
"description": "Sort the underlying list by the given key.",
"enum": ["POSITION", "ID", "RELEVANCE"],
"default": "POSITION"
}
}
},
"description": "The media associated with the product. This can include images, 3D models, or videos."
},
"mediaCount": {
"type": "integer",
"@mapping": "fcommerce-inc:Product.mediaCount",
"description": "Total count of media belonging to a product."
},
"metafield": {
"@ref": "fcommerce-inc:Metafield",
"@mapping": "fcommerce-inc:Product.metafield",
"@args": {
"type": "object",
"properties": {
"namespace": {
"type": "string",
"description": "The namespace for the metafield."
},
"key": {
"type": "string",
"description": "The key for the metafield."
}
},
"required": ["namespace", "key"]
},
"description": "Returns a metafield by namespace and key that belongs to the resource."
},
"metafields": {
"@ref": "fcommerce-inc:MetafieldConnection",
"@mapping": "fcommerce-inc:Product.metafields",
"@args": {
"type": "object",
"properties": {
"namespace": {
"type": "string",
"description": "The metafield namespace to filter by."
},
"first": {
"type": "integer",
"description": "Returns up to the first `n` elements from the list."
},
"after": {
"type": "string",
"description": "Returns the elements that come after the specified cursor."
},
"last": {
"type": "integer",
"description": "Returns up to the last `n` elements from the list."
},
"before": {
"type": "string",
"description": "Returns the elements that come before the specified cursor."
},
"reverse": {
"type": "boolean",
"description": "Reverse the order of the underlying list.",
"default": false
}
}
},
"description": "List of metafields that belong to the resource."
},
"onlineStorePreviewUrl": {
"description": "The online store preview URL.",
"@tag": "URL",
"@mapping": "fcommerce-inc:Product.onlineStorePreviewUrl"
},
"onlineStoreUrl": {
"description": "The online store URL for the product.\nA value of `null` indicates that the product is not published to the Online Store sales channel.",
"@tag": "URL",
"@mapping": "fcommerce-inc:Product.onlineStoreUrl"
},
"options": {
"type": "array",
"items": { "@ref": "fcommerce-inc:ProductOption" },
"@mapping": "fcommerce-inc:Product.options",
"@args": {
"type": "object",
"properties": {
"first": {
"type": "integer",
"description": "Truncate the array result to this size."
}
}
},
"description": "A list of product options. The limit is specified by Shop.resourceLimits.maxProductOptions."
},
"priceRange": {
"@ref": "fcommerce-inc:ProductPriceRange",
"@mapping": "fcommerce-inc:Product.priceRange",
"@deprecationReason": "Deprecated in API version 2020-10. Use `priceRangeV2` instead.",
"description": "The price range of the product."
},
"priceRangeV2": {
"@ref": "fcommerce-inc:ProductPriceRangeV2",
"@mapping": "fcommerce-inc:Product.priceRangeV2",
"description": "The price range of the product with prices formatted as decimals."
},
"privateMetafield": {
"@ref": "fcommerce-inc:PrivateMetafield",
"@mapping": "fcommerce-inc:Product.privateMetafield",
"@args": {
"type": "object",
"properties": {
"namespace": {
"type": "string",
"description": "The namespace for the private metafield."
},
"key": {
"type": "string",
"description": "The key for the private metafield."
}
},
"required": ["namespace", "key"]
},
"description": "Returns a private metafield by namespace and key that belongs to the resource."
},
"privateMetafields": {
"@ref": "fcommerce-inc:PrivateMetafieldConnection",
"@mapping": "fcommerce-inc:Product.privateMetafields",
"@args": {
"type": "object",
"properties": {
"namespace": {
"type": "string",
"description": "Filter the private metafields by namespace."
},
"first": {
"type": "integer",
"description": "Returns up to the first `n` elements from the list."
},
"after": {
"type": "string",
"description": "Returns the elements that come after the specified cursor."
},
"last": {
"type": "integer",
"description": "Returns up to the last `n` elements from the list."
},
"before": {
"type": "string",
"description": "Returns the elements that come before the specified cursor."
},
"reverse": {
"type": "boolean",
"description": "Reverse the order of the underlying list.",
"default": false
}
}
},
"description": "List of private metafields that belong to the resource."
},
"productPublications": {
"@ref": "fcommerce-inc:ProductPublicationConnection",
"@mapping": "fcommerce-inc:Product.productPublications",
"@deprecationReason": "Use `resourcePublications` instead",
"@args": {
"type": "object",
"properties": {
"first": {
"type": "integer",
"description": "Returns up to the first `n` elements from the list."
},
"after": {
"type": "string",
"description": "Returns the elements that come after the specified cursor."
},
"last": {
"type": "integer",
"description": "Returns up to the last `n` elements from the list."
},
"before": {
"type": "string",
"description": "Returns the elements that come before the specified cursor."
},
"reverse": {
"type": "boolean",
"description": "Reverse the order of the underlying list.",
"default": false
}
}
},
"description": "A list of the channels where the product is published."
},
"productType": {
"type": "string",
"@mapping": "fcommerce-inc:Product.productType",
"description": "The product type specified by the merchant."
},
"publicationCount": {
"type": "integer",
"@mapping": "fcommerce-inc:Product.publicationCount",
"@args": {
"type": "object",
"properties": {
"onlyPublished": {
"type": "boolean",
"description": "Include only the resource's publications that are published. If false, then\nreturn all the resource's publications including future publications.",
"default": true
}
}
},
"description": "The number of publications a resource is published on."
},
"publications": {
"@ref": "fcommerce-inc:ProductPublicationConnection",
"@mapping": "fcommerce-inc:Product.publications",
"@deprecationReason": "Use `resourcePublications` instead",
"@args": {
"type": "object",
"properties": {
"onlyPublished": {
"type": "boolean",
"description": "Return only the publications that are published. If false, then return all publications.",
"default": true
},
"first": {
"type": "integer",
"description": "Returns up to the first `n` elements from the list."
},
"after": {
"type": "string",
"description": "Returns the elements that come after the specified cursor."
},
"last": {
"type": "integer",
"description": "Returns up to the last `n` elements from the list."
},
"before": {
"type": "string",
"description": "Returns the elements that come before the specified cursor."
},
"reverse": {
"type": "boolean",
"description": "Reverse the order of the underlying list.",
"default": false
}
}
},
"description": "A list of the channels where the product is published."
},
"publishedAt": {
"description": "The date and time ([ISO 8601 format](http://en.wikipedia.org/wiki/ISO_8601))\nwhen the product was published to the Online Store.",
"@tag": "DateTime",
"@mapping": "fcommerce-inc:Product.publishedAt"
},
"publishedOnChannel": {
"type": "boolean",
"@mapping": "fcommerce-inc:Product.publishedOnChannel",
"@deprecationReason": "Use `publishedOnPublication` instead",
"@args": {
"type": "object",
"properties": {
"channelId": {
"type": "string",
"@tag": "id",
"description": "The ID of the channel to check."
}
},
"required": ["channelId"]
},
"description": "Check to see whether the resource is published to a given channel."
},
"publishedOnCurrentChannel": {
"type": "boolean",
"@mapping": "fcommerce-inc:Product.publishedOnCurrentChannel",
"@deprecationReason": "Use `publishedOnCurrentPublication` instead",
"description": "Check to see whether the resource is published to the calling app's channel."
},
"publishedOnCurrentPublication": {
"type": "boolean",
"@mapping": "fcommerce-inc:Product.publishedOnCurrentPublication",
"description": "Check to see whether the resource is published to the calling app's publication."
},
"publishedOnPublication": {
"type": "boolean",
"@mapping": "fcommerce-inc:Product.publishedOnPublication",
"@args": {
"type": "object",
"properties": {
"publicationId": {
"type": "string",
"@tag": "id",
"description": "The ID of the publication to check."
}
},
"required": ["publicationId"]
},
"description": "Check to see whether the resource is published to a given publication."
},
"resourcePublications": {
"@ref": "fcommerce-inc:ResourcePublicationConnection",
"@mapping": "fcommerce-inc:Product.resourcePublications",
"@args": {
"type": "object",
"properties": {
"onlyPublished": {
"type": "boolean",
"description": "Whether to return only the resources that are currently published. If false,\nthen also returns the resources that are scheduled to be published.",
"default": true
},
"first": {
"type": "integer",
"description": "Returns up to the first `n` elements from the list."
},
"after": {
"type": "string",
"description": "Returns the elements that come after the specified cursor."
},
"last": {
"type": "integer",
"description": "Returns up to the last `n` elements from the list."
},
"before": {
"type": "string",
"description": "Returns the elements that come before the specified cursor."
},
"reverse": {
"type": "boolean",
"description": "Reverse the order of the underlying list.",
"default": false
}
}
},
"description": "The list of resources that are published to a publication."
},
"resourcePublicationsV2": {
"@ref": "fcommerce-inc:ResourcePublicationV2Connection",
"@mapping": "fcommerce-inc:Product.resourcePublicationsV2",
"@args": {
"type": "object",
"properties": {
"onlyPublished": {
"type": "boolean",
"description": "Whether to return only the resources that are currently published. If false,\nthen also returns the resources that are scheduled or staged to be published.",
"default": true
},
"first": {
"type": "integer",
"description": "Returns up to the first `n` elements from the list."
},
"after": {
"type": "string",
"description": "Returns the elements that come after the specified cursor."
},
"last": {
"type": "integer",
"description": "Returns up to the last `n` elements from the list."
},
"before": {
"type": "string",
"description": "Returns the elements that come before the specified cursor."
},
"reverse": {
"type": "boolean",
"description": "Reverse the order of the underlying list.",
"default": false
}
}
},
"description": "The list of resources that are either published or staged to be published to a publication."
},
"seo": {
"@ref": "fcommerce-inc:SEO",
"@mapping": "fcommerce-inc:Product.seo",
"description": "SEO information of the product."
},
"status": {
"description": "The product status. This controls visibility across all channels.",
"enum": ["ACTIVE", "ARCHIVED", "DRAFT"],
"@mapping": "fcommerce-inc:Product.status"
},
"storefrontId": {
"description": "The storefront ID of the product.",
"@tag": "StorefrontID",
"@mapping": "fcommerce-inc:Product.storefrontId"
},
"tags": {
"type": "array",
"items": { "type": "string" },
"@mapping": "fcommerce-inc:Product.tags",
"description": "A comma separated list of tags associated with the product. Updating `tags` overwrites\nany existing tags that were previously added to the product. To add new tags without overwriting\nexisting tags, use the [tagsAdd](https://shopify.dev/docs/admin-api/graphql/reference/common-objects/tagsadd)\nmutation."
},
"templateSuffix": {
"type": "string",
"@mapping": "fcommerce-inc:Product.templateSuffix",
"description": "The theme template used when viewing the product in a store."
},
"title": {
"type": "string",
"@mapping": "fcommerce-inc:Product.title",
"description": "The title of the product."
},
"totalVariants": {
"type": "integer",
"@mapping": "fcommerce-inc:Product.totalVariants",
"description": "The number of variants that are associated with the product."
},
"translations": {
"type": "array",
"items": { "@ref": "fcommerce-inc:PublishedTranslation" },
"@mapping": "fcommerce-inc:Product.translations",
"@args": {
"type": "object",
"properties": {
"locale": {
"type": "string",
"description": "Filters translations locale."
}
},
"required": ["locale"]
},
"description": "The translations associated with the resource."
},
"unpublishedChannels": {
"@ref": "fcommerce-inc:ChannelConnection",
"@mapping": "fcommerce-inc:Product.unpublishedChannels",
"@deprecationReason": "Use `unpublishedPublications` instead",
"@args": {
"type": "object",
"properties": {
"first": {
"type": "integer",
"description": "Returns up to the first `n` elements from the list."
},
"after": {
"type": "string",
"description": "Returns the elements that come after the specified cursor."
},
"last": {
"type": "integer",
"description": "Returns up to the last `n` elements from the list."
},
"before": {
"type": "string",
"description": "Returns the elements that come before the specified cursor."
},
"reverse": {
"type": "boolean",
"description": "Reverse the order of the underlying list.",
"default": false
}
}
},
"description": "The list of channels that the resource is not published to."
},
"unpublishedPublications": {
"@ref": "fcommerce-inc:PublicationConnection",
"@mapping": "fcommerce-inc:Product.unpublishedPublications",
"@args": {
"type": "object",
"properties": {
"first": {
"type": "integer",
"description": "Returns up to the first `n` elements from the list."
},
"after": {
"type": "string",
"description": "Returns the elements that come after the specified cursor."
},
"last": {
"type": "integer",
"description": "Returns up to the last `n` elements from the list."
},
"before": {
"type": "string",
"description": "Returns the elements that come before the specified cursor."
},
"reverse": {
"type": "boolean",
"description": "Reverse the order of the underlying list.",
"default": false
}
}
},
"description": "The list of publications that the resource is not published to."
},
"updatedAt": {
"description": "The date and time when the product was last modified.\nA product's `updatedAt` value can change for different reasons. For example, if an order\nis placed for a product that has inventory tracking set up, then the inventory adjustment\nis counted as an update.",
"@tag": "DateTime",
"@mapping": "fcommerce-inc:Product.updatedAt"
},
"variants": {
"@ref": "fcommerce-inc:ProductVariantConnection",
"@mapping": "fcommerce-inc:Product.variants",
"@args": {
"type": "object",
"properties": {
"first": {
"type": "integer",
"description": "Returns up to the first `n` elements from the list."
},
"after": {
"type": "string",
"description": "Returns the elements that come after the specified cursor."
},
"last": {
"type": "integer",
"description": "Returns up to the last `n` elements from the list."
},
"before": {
"type": "string",
"description": "Returns the elements that come before the specified cursor."
},
"reverse": {
"type": "boolean",
"description": "Reverse the order of the underlying list.",
"default": false
},
"sortKey": {
"description": "Sort the underlying list by the given key.",
"enum": [
"TITLE",
"NAME",
"SKU",
"INVENTORY_QUANTITY",
"INVENTORY_MANAGEMENT",
"INVENTORY_LEVELS_AVAILABLE",
"INVENTORY_POLICY",
"FULL_TITLE",
"POPULAR",
"POSITION",
"ID",
"RELEVANCE"
],
"default": "POSITION"
}
}
},
"description": "A list of variants associated with the product."
},
"vendor": {
"type": "string",
"@mapping": "fcommerce-inc:Product.vendor",
"description": "The name of the product's vendor."
}
},
"required": [
"availablePublicationCount",
"collections",
"createdAt",
"defaultCursor",
"description",
"descriptionHtml",
"descriptionPlainSummary",
"handle",
"hasOnlyDefaultVariant",
"hasOutOfStockVariants",
"id",
"images",
"inCollection",
"isGiftCard",
"legacyResourceId",
"media",
"mediaCount",
"metafields",
"options",
"priceRange",
"priceRangeV2",
"privateMetafields",
"productPublications",
"productType",
"publicationCount",
"publications",
"publishedOnChannel",
"publishedOnCurrentChannel",
"publishedOnCurrentPublication",
"publishedOnPublication",
"resourcePublications",
"resourcePublicationsV2",
"seo",
"status",
"storefrontId",
"tags",
"title",
"totalVariants",
"tracksInventory",
"translations",
"unpublishedChannels",
"unpublishedPublications",
"updatedAt",
"variants",
"vendor"
]
}
}
},
"workflows": {},
"forms": {
"ShopifyProduct": {
"default": {
"properties": {
"name": { "widget": "singleLineText" },
"shopifyProduct": {
"properties": {
"descriptionHtml": {
"widget": "serviceObjectProperty",
"provider": "shopify"
},
"handle": {
"widget": "serviceObjectProperty",
"provider": "shopify"
},
"redirectNewHandle": {
"widget": "serviceObjectProperty",
"provider": "shopify"
},
"productType": {
"widget": "serviceObjectProperty",
"provider": "shopify"
},
"tags": {
"widget": "serviceObjectProperty",
"provider": "shopify"
},
"templateSuffix": {
"widget": "serviceObjectProperty",
"provider": "shopify"
},
"giftCard": {
"widget": "serviceObjectProperty",
"provider": "shopify"
},
"giftCardTemplateSuffix": {
"widget": "serviceObjectProperty",
"provider": "shopify"
},
"title": {
"widget": "serviceObjectProperty",
"provider": "shopify"
},
"vendor": {
"widget": "serviceObjectProperty",
"provider": "shopify"
},
"bodyHtml": {
"widget": "serviceObjectProperty",
"provider": "shopify"
},
"images": {
"widget": "shopifyProductImages",
"provider": "shopify"
},
"publishedAt": {
"widget": "serviceObjectProperty",
"provider": "shopify"
},
"variants": {
"widget": "shopifyRelationshipSummary",
"provider": "shopify"
}
},
"widget": "shopify",
"wrapper": "shopifyServiceWrapper",
"order": [
"title",
"handle",
"descriptionHtml",
"bodyHtml",
"tags",
"vendor",
"publishedAt",
"variants",
"images",
"redirectNewHandle",
"productType",
"templateSuffix",
"giftCard",
"giftCardTemplateSuffix"
]
},
"shopifyProductId": {
"instructions": "Format: gid://shopify/Product/1111111111111",
"label": "product ID",
"widget": "serviceObjectId",
"provider": "shopify",
"serviceObjectType": "product",
"service": "fcommerce-inc"
}
},
"order": ["name", "shopifyProductId", "shopifyProduct"]
}
},
"ShopifyProductVariant": {
"default": {
"properties": {
"name": { "widget": "singleLineText" },
"shopifyProductVariant": {
"properties": {
"barcode": {
"widget": "serviceObjectProperty",
"provider": "shopify"
},
"compareAtPrice": {
"widget": "serviceObjectProperty",
"provider": "shopify"
},
"fulfillmentServiceId": {
"widget": "serviceObjectProperty",
"provider": "shopify"
},
"options": {
"widget": "serviceObjectProperty",
"provider": "shopify"
},
"position": {
"widget": "serviceObjectProperty",
"provider": "shopify"
},
"price": {
"widget": "serviceObjectProperty",
"provider": "shopify"
},
"productId": {
"widget": "serviceObjectProperty",
"provider": "shopify"
},
"sku": {
"widget": "serviceObjectProperty",
"provider": "shopify"
},
"taxable": {
"widget": "serviceObjectProperty",
"provider": "shopify"
},
"title": {
"widget": "serviceObjectProperty",
"provider": "shopify"
},
"taxCode": {
"widget": "serviceObjectProperty",
"provider": "shopify"
},
"weight": {
"widget": "serviceObjectProperty",
"provider": "shopify"
},
"weightUnit": {
"widget": "serviceObjectProperty",
"provider": "shopify"
},
"image": {
"widget": "shopifyCollectionImage",
"provider": "shopify"
}
},
"widget": "shopify",
"wrapper": "shopifyServiceWrapper",
"order": [
"title",
"productId",
"options",
"barcode",
"sku",
"price",
"compareAtPrice",
"image",
"fulfillmentServiceId",
"position",
"taxable",
"taxCode",
"weight",
"weightUnit"
]
},
"shopifyProductVariantId": {
"instructions": "Format: gid://shopify/ProductVariant/1111111111111",
"label": "productVariant ID",
"widget": "serviceObjectId",
"provider": "shopify",
"serviceObjectType": "productVariant",
"service": "fcommerce-inc"
}
},
"order": ["name", "shopifyProductVariantId", "shopifyProductVariant"]
}
},
"Collection": {
"default": {
"properties": {
"name": { "widget": "singleLineText" },
"shopifyCollection": {
"properties": {
"descriptionHtml": {
"widget": "serviceObjectProperty",
"provider": "shopify"
},
"handle": {
"widget": "serviceObjectProperty",
"provider": "shopify"
},
"image": {
"widget": "shopifyCollectionImage",
"provider": "shopify"
},
"products": {
"widget": "shopifyRelationshipSummary",
"provider": "shopify"
},
"templateSuffix": {
"widget": "serviceObjectProperty",
"provider": "shopify"
},
"sortOrder": {
"widget": "serviceObjectProperty",
"provider": "shopify"
},
"title": {
"widget": "serviceObjectProperty",
"provider": "shopify"
},
"redirectNewHandle": {
"widget": "serviceObjectProperty",
"provider": "shopify"
}
},
"widget": "shopify",
"wrapper": "shopifyServiceWrapper",
"order": [
"title",
"handle",
"descriptionHtml",
"products",
"image",
"templateSuffix",
"sortOrder",
"redirectNewHandle"
]
},
"shopifyCollectionId": {
"instructions": "Format: gid://shopify/Collection/1111111111111",
"label": "collection ID",
"widget": "serviceObjectId",
"provider": "shopify",
"serviceObjectType": "collection",
"service": "fcommerce-inc"
}
},
"order": ["name", "shopifyCollectionId", "shopifyCollection"]
}
}
},
"services": {
"pim": {
"id": "pim",
"provider": "generic",
"title": "pimv2",
"namespace": "PIM",
"serviceType": "rest",
"authenticationType": "none",
"options": {
"headers": {
"x-site-context": "{\"date\":\"2021-08-09T15:17:33.500Z\",\"channel\":12,\"account\":\"60b910a9b9d1b20008fae769\", \"stage\":\"sandbox\"}"
},
"endpoint": "https://sandbox.copilot.fabric.inc/api-product/"
}
},
"inventory": {
"id": "inventory",
"provider": "generic",
"title": "Inventory",
"namespace": "Inventory",
"serviceType": "rest",
"authenticationType": "none",
"options": {
"headers": {
"x-site-context": "{\"date\":\"2021-08-09T15:17:33.500Z\",\"channel\":12,\"account\":\"60b910a9b9d1b20008fae769\", \"stage\":\"sandbox\"}"
},
"endpoint": "https://uat01-apigw.refstorefrontdev.fabric.zone/api-inventory/"
}
},
"price": {
"id": "price",
"provider": "generic",
"title": "Price",
"namespace": "Price",
"serviceType": "rest",
"authenticationType": "none",
"options": {
"headers": {
"x-site-context": "{\"date\":\"2021-09-21T15:29:29.356Z\",\"channel\":12,\"account\":\"60b910a9b9d1b20008fae769\", \"stage\":\"sandbox\"}"
},
"endpoint": "https://uat01-apigw.refstorefrontdev.fabric.zone/api-price/"
}
},
"cart-init": {
"id": "cart-init",
"provider": "generic",
"title": "Cart-Init",
"namespace": "CartInit",
"serviceType": "rest",
"authenticationType": "none",
"options": { "endpoint": "https://cart.dev.cart.fabric.inc" }
},
"store-api-hw": {
"id": "store-api-hw",
"provider": "generic",
"title": "Store-api-hw",
"namespace": "StoreHW",
"serviceType": "rest",
"authenticationType": "none",
"options": { "endpoint": "https://store-api.qa.storefront.fabric.inc" }
},
"copilot-layer": {
"id": "copilot-layer",
"provider": "generic",
"title": "copilot-layer",
"namespace": "CopilotLayer",
"serviceType": "rest",
"authenticationType": "none",
"options": {
"headers": {
"x-site-context": "{\"date\":\"2021-08-09T15:17:33.500Z\",\"channel\":12,\"account\":\"60b910a9b9d1b20008fae769\", \"stage\":\"sandbox\"}"
},
"endpoint": "https://sandbox.copilot.fabric.inc"
}
},
"fcommerce-inc": {
"title": "fcommerce",
"namespace": "Shopify",
"provider": "shopify",
"serviceType": "graphql",
"authenticationType": "oauth2Bearer",
"authentication": "AdSNQGk2CZ9btSn9Y26V9IWjOO04R1c5/Piur0sVCqfU7cEM3UQF/j65ORbsi7UUw9IysSME1sOgIdpkaB45/wVhJEE6AJE9wb0Tr1DnvuY31sARktFYI1bV5zGiIFLrVbZY8438pzZ0KBBw/Tb4Qb8rTrAnfdIM+NuqD3UxfhdTUFmK3nvRFTCtbTDTd1vwOXdu",
"options": {
"shop": "fcommerce-inc",
"endpoint": "https://fcommerce-inc.myshopify.com/admin/api/2020-07/graphql.json"
},
"id": "fcommerce-inc"
}
}
}
{
"version": 2,
"defaultLocale": "en-us",
"projectId": "33d5a3c2-1d6b-4d3b-a899-b7a038e5c588",
"dataKey": "AQIDAHi9nATJb1LYgj5u7ShOGp43y2H6TuckRKGDlwTU4b6ryQHqGUTdpQ8jICNmIoCp/TFzAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMn99c8BNaU1KiVYtVAgEQgDsON/SmHTt7fMy66iCX+bKL9mSDTD6Wl3d3WdHgL23ow1gYxojKFkcr1aPCFTb9OK8ytdvHGaepj50h0A==",
"locales": ["en-us"],
"apiVersion": "2",
"schemaVersion": "3.6.0",
"created": "2021-08-25T00:19:30.305Z",
"updated": "2021-09-22T14:27:10.893Z",
"queries": {
"testStoreAPI": {
"description": "Returns sample response",
"args": "StoreArgs",
"shape": "StoreShape",
"resolver": {
"name": "rest:post",
"service": "store-api-hw",
"options": { "path": "/hello-world" },
"argsMapping": { "json": [["get", { "path": "args.payload" }]] }
}
},
"getCategoryTree": {
"shape": "CategoryTree",
"resolver": {
"resultsMapping": [["get", { "path": "steps[0]" }]],
"id": "category-tree",
"name": "rest:get",
"service": "copilot-layer",
"options": { "path": "/api-category/v1/category/tree" },
"searchParamsMapping": [["id", [["get", { "path": "args.id" }]]]]
},
"description": "Returns Category Tree",
"args": "CategoryTreeArgs"
},
"getProductDetails": {
"shape": "Product",
"resolver": {
"resultsMapping": [["get", { "path": "steps[0].products[0]" }]],
"id": "product",
"name": "rest:get",
"service": "pim",
"options": { "path": "/v1/product" },
"searchParamsMapping": [
[
"skus",
[
[
"expressionEval",
{ "expression": "'[\"' + args.input.sku + '\"]'" }
]
]
]
]
},
"description": "Returns Product Details",
"args": "ProductDetailsInput"
},
"getShopifyProductDetails": {
"shape": "fcommerce-inc:Product",
"resolver": {
"id": "product",
"name": "graphql:query",
"service": "fcommerce-inc",
"options": { "fieldName": "product" },
"argsMapping": { "id": [["get", { "path": "args.id" }]] }
},
"description": "Returns Shopify Details",
"args": "ShopifyProductDetailsInput"
},
"getCartInit": {
"description": "Returns sample response",
"shape": "CartInitShape",
"resolver": {
"name": "rest:get",
"service": "cart-init",
"options": { "path": "/cart" }
}
},
"getGenericInventory": {
"description": "Returns Generic Inventory",
"args": "InventoryArgs",
"shape": "GenericInventory",
"resolver": {
"name": "rest:get",
"service": "inventory",
"options": { "path": "/inventory/generic/{itemId}?query=itemId" },
"argsMapping": {
"pathParams.itemId": [["get", { "path": "args.itemId" }]]
}
}
},
"getInventory": {
"description": "Returns Inventory",
"args": "InventoryArgs",
"shape": { "type": "array", "items": { "@ref": "local:Inventory" } },
"resolver": {
"name": "rest:post",
"service": "inventory",
"options": { "path": "/inventory" },
"argsMapping": { "json": [["get", { "path": "args.payload" }]] }
}
},
"getProducts": {
"description": "Returns Products",
"args": "ItemProductArgs",
"shape": "ItemProduct",
"resolver": {
"name": "rest:get",
"service": "pim",
"options": { "path": "/v1/product" },
"searchParamsMapping": [
["itemIds", [["get", { "path": "args.itemIds" }]]],
["size", [["get", { "path": "args.size" }]]],
["page", [["get", { "path": "args.page" }]]]
]
}
},
"getItemProductFilter": {
"description": "Returns Item Product",
"args": "ItemProductArgs",
"shape": "ItemProductFilter",
"resolver": {
"name": "rest:get",
"service": "pim",
"options": { "path": "/v1/product" },
"searchParamsMapping": [
["itemIds", [["get", { "path": "args.itemIds" }]]],
["size", [["get", { "path": "args.size" }]]],
["page", [["get", { "path": "args.page" }]]]
],
"resultsMapping": [
[
"expressionEval",
{
"expression": "update('products', map(update('attributes', compose(mapKeys(camelCase), mapValues(get('value')), keyBy('name')))))(steps[0])"
}
]
]
}
},
"getPrice": {
"description": "Returns Price",
"args": "PriceArgs",
"shape": { "type": "array", "items": { "@ref": "local:Price" } },
"resolver": {
"name": "rest:post",
"service": "price",
"options": { "path": "/offer/get-by-itemIds" },
"argsMapping": { "json": [["get", { "path": "args.payload" }]] }
}
},
"getShopifyProduct": {
"shape": "ShopifyProduct",
"resolver": {
"name": "takeshape:get",
"service": "takeshape:local",
"options": { "model": "ShopifyProduct" }
},
"description": "Get a ShopifyProduct by ID",
"args": "TSGetArgs<ShopifyProduct>"
},
"getShopifyProductList": {
"shape": "PaginatedList<ShopifyProduct>",
"resolver": {
"name": "takeshape:list",
"service": "takeshape:local",
"options": { "model": "ShopifyProduct" }
},
"description": "Returns a list ShopifyProduct in natural order.",
"args": "TSListArgs<ShopifyProduct>"
},
"getShopifyProductVariant": {
"shape": "ShopifyProductVariant",
"resolver": {
"name": "takeshape:get",
"service": "takeshape:local",
"options": { "model": "ShopifyProductVariant" }
},
"description": "Get a ShopifyProductVariant by ID",
"args": "TSGetArgs<ShopifyProductVariant>"
},
"getShopifyProductVariantList": {
"shape": "PaginatedList<ShopifyProductVariant>",
"resolver": {
"name": "takeshape:list",
"service": "takeshape:local",
"options": { "model": "ShopifyProductVariant" }
},
"description": "Returns a list ShopifyProductVariant in natural order.",
"args": "TSListArgs<ShopifyProductVariant>"
},
"getCollection": {
"shape": "Collection",
"resolver": {
"name": "takeshape:get",
"service": "takeshape:local",
"options": { "model": "Collection" }
},
"description": "Get a Collection by ID",
"args": "TSGetArgs<Collection>"
},
"getCollectionList": {
"shape": "PaginatedList<Collection>",
"resolver": {
"name": "takeshape:list",
"service": "takeshape:local",
"options": { "model": "Collection" }
},
"description": "Returns a list Collection in natural order.",
"args": "TSListArgs<Collection>"
}
},
"mutations": {
"updateShopifyProduct": {
"shape": "UpdateResult<ShopifyProduct>",
"resolver": {
"compose": [
{
"id": "createNewShopifyObject",
"if": "isEmpty(args.input.shopifyProductId) && !isEmpty(args.input.shopifyProduct)",
"argsMapping": {
"input.descriptionHtml": [
["get", { "path": "args.input.shopifyProduct.descriptionHtml" }]
],
"input.handle": [
["get", { "path": "args.input.shopifyProduct.handle" }]
],
"input.redirectNewHandle": [
[
"get",
{ "path": "args.input.shopifyProduct.redirectNewHandle" }
]
],
"input.productType": [
["get", { "path": "args.input.shopifyProduct.productType" }]
],
"input.tags": [
["get", { "path": "args.input.shopifyProduct.tags" }]
],
"input.templateSuffix": [
["get", { "path": "args.input.shopifyProduct.templateSuffix" }]
],
"input.giftCard": [
["get", { "path": "args.input.shopifyProduct.giftCard" }]
],
"input.giftCardTemplateSuffix": [
[
"get",
{ "path": "args.input.shopifyProduct.giftCardTemplateSuffix" }
]
],
"input.title": [
["get", { "path": "args.input.shopifyProduct.title" }]
],
"input.vendor": [
["get", { "path": "args.input.shopifyProduct.vendor" }]
],
"input.bodyHtml": [
["get", { "path": "args.input.shopifyProduct.bodyHtml" }]
]
},
"name": "graphql:mutation",
"service": "fcommerce-inc",
"options": {
"fieldName": "productCreate",
"selectionSet": "{ product { id } }"
}
},
{
"id": "editTakeshape",
"argsMapping": {
"input": [["get", { "path": "args.input" }]],
"input.shopifyProductId": [
["get", { "path": "steps.createNewShopifyObject.product.id" }],
["get", { "path": "args.input.shopifyProductId" }]
]
},
"name": "takeshape:update",
"service": "takeshape:local",
"options": { "model": "ShopifyProduct" }
},
{
"id": "updateExistingShopifyObject",
"if": "!isEmpty(args.input.shopifyProductId) && !isEmpty(args.input.shopifyProduct)",
"argsMapping": {
"input.descriptionHtml": [
["get", { "path": "args.input.shopifyProduct.descriptionHtml" }]
],
"input.handle": [
["get", { "path": "args.input.shopifyProduct.handle" }]
],
"input.redirectNewHandle": [
[
"get",
{ "path": "args.input.shopifyProduct.redirectNewHandle" }
]
],
"input.productType": [
["get", { "path": "args.input.shopifyProduct.productType" }]
],
"input.tags": [
["get", { "path": "args.input.shopifyProduct.tags" }]
],
"input.templateSuffix": [
["get", { "path": "args.input.shopifyProduct.templateSuffix" }]
],
"input.giftCard": [
["get", { "path": "args.input.shopifyProduct.giftCard" }]
],
"input.giftCardTemplateSuffix": [
[
"get",
{ "path": "args.input.shopifyProduct.giftCardTemplateSuffix" }
]
],
"input.title": [
["get", { "path": "args.input.shopifyProduct.title" }]
],
"input.vendor": [
["get", { "path": "args.input.shopifyProduct.vendor" }]
],
"input.bodyHtml": [
["get", { "path": "args.input.shopifyProduct.bodyHtml" }]
],
"input.id": [["get", { "path": "args.input.shopifyProductId" }]]
},
"name": "graphql:mutation",
"service": "fcommerce-inc",
"options": {
"fieldName": "productUpdate",
"selectionSet": "{ product { id } }"
}
}
],
"resultsMapping": {
"result": [["get", { "path": "steps.editTakeshape.result" }]]
}
},
"description": "Update ShopifyProduct. If the input has Shopify values and a Shopify ID, the Shopify product with that ID is updated.\nIf the input has Shopify values and no Shopify ID, a Shopify product is created.",
"args": "UpdateArgs<ShopifyProductInterface>"
},
"createShopifyProduct": {
"shape": "CreateResult<ShopifyProduct>",
"resolver": {
"compose": [
{
"id": "shopifyCreate",
"if": "!isEmpty(args.input.shopifyProduct)",
"argsMapping": {
"input.descriptionHtml": [
["get", { "path": "args.input.shopifyProduct.descriptionHtml" }]
],
"input.handle": [
["get", { "path": "args.input.shopifyProduct.handle" }]
],
"input.redirectNewHandle": [
[
"get",
{ "path": "args.input.shopifyProduct.redirectNewHandle" }
]
],
"input.productType": [
["get", { "path": "args.input.shopifyProduct.productType" }]
],
"input.tags": [
["get", { "path": "args.input.shopifyProduct.tags" }]
],
"input.templateSuffix": [
["get", { "path": "args.input.shopifyProduct.templateSuffix" }]
],
"input.giftCard": [
["get", { "path": "args.input.shopifyProduct.giftCard" }]
],
"input.giftCardTemplateSuffix": [
[
"get",
{ "path": "args.input.shopifyProduct.giftCardTemplateSuffix" }
]
],
"input.title": [
["get", { "path": "args.input.shopifyProduct.title" }]
],
"input.vendor": [
["get", { "path": "args.input.shopifyProduct.vendor" }]
],
"input.bodyHtml": [
["get", { "path": "args.input.shopifyProduct.bodyHtml" }]
]
},
"name": "graphql:mutation",
"service": "fcommerce-inc",
"options": {
"fieldName": "productCreate",
"selectionSet": "{ product { id } }"
}
},
{
"id": "creatingShopifyObject",
"if": "!isEmpty(args.input.shopifyProduct)",
"argsMapping": {
"input": [["get", { "path": "args.input" }]],
"input.shopifyProductId": [
["get", { "path": "steps.shopifyCreate.product.id" }]
]
},
"name": "takeshape:create",
"service": "takeshape:local",
"options": { "model": "ShopifyProduct" }
},
{
"id": "notCreatingShopifyObject",
"if": "isEmpty(args.input.shopifyProduct)",
"argsMapping": { "input": [["get", { "path": "args.input" }]] },
"name": "takeshape:create",
"service": "takeshape:local",
"options": { "model": "ShopifyProduct" }
}
],
"resultsMapping": {
"result": [
["get", { "path": "steps.creatingShopifyObject.result" }],
["get", { "path": "steps.notCreatingShopifyObject.result" }]
]
}
},
"description": "Create ShopifyProduct. If Shopify values are provided, a Shopify product is also created and the new product ID is saved.",
"args": "CreateArgs<ShopifyProductInterface>"
},
"duplicateShopifyProduct": {
"shape": "DuplicateResult<ShopifyProduct>",
"resolver": {
"name": "takeshape:duplicate",
"service": "takeshape:local",
"options": { "model": "ShopifyProduct" }
},
"description": "Duplicate ShopifyProduct",
"args": "DuplicateArgs<ShopifyProduct>"
},
"deleteShopifyProduct": {
"shape": "DeleteResult<ShopifyProduct>",
"resolver": {
"name": "takeshape:delete",
"service": "takeshape:local",
"options": { "model": "ShopifyProduct" }
},
"description": "Delete ShopifyProduct",
"args": "DeleteArgs<ShopifyProduct>"
},
"updateShopifyProductVariant": {
"shape": "UpdateResult<ShopifyProductVariant>",
"resolver": {
"compose": [
{
"id": "createNewShopifyObject",
"if": "isEmpty(args.input.shopifyProductVariantId) && !isEmpty(args.input.shopifyProductVariant)",
"argsMapping": {
"input.barcode": [
["get", { "path": "args.input.shopifyProductVariant.barcode" }]
],
"input.compareAtPrice": [
[
"get",
{ "path": "args.input.shopifyProductVariant.compareAtPrice" }
]
],
"input.fulfillmentServiceId": [
[
"get",
{
"path": "args.input.shopifyProductVariant.fulfillmentServiceId"
}
]
],
"input.options": [
["get", { "path": "args.input.shopifyProductVariant.options" }]
],
"input.position": [
["get", { "path": "args.input.shopifyProductVariant.position" }]
],
"input.price": [
["get", { "path": "args.input.shopifyProductVariant.price" }]
],
"input.sku": [
["get", { "path": "args.input.shopifyProductVariant.sku" }]
],
"input.taxable": [
["get", { "path": "args.input.shopifyProductVariant.taxable" }]
],
"input.taxCode": [
["get", { "path": "args.input.shopifyProductVariant.taxCode" }]
],
"input.weight": [
["get", { "path": "args.input.shopifyProductVariant.weight" }]
],
"input.weightUnit": [
[
"get",
{ "path": "args.input.shopifyProductVariant.weightUnit" }
]
]
},
"name": "graphql:mutation",
"service": "fcommerce-inc",
"options": {
"fieldName": "productVariantCreate",
"selectionSet": "{ productVariant { id } }"
}
},
{
"id": "editTakeshape",
"argsMapping": {
"input": [["get", { "path": "args.input" }]],
"input.shopifyProductVariantId": [
[
"get",
{ "path": "steps.createNewShopifyObject.productVariant.id" }
],
["get", { "path": "args.input.shopifyProductVariantId" }]
]
},
"name": "takeshape:update",
"service": "takeshape:local",
"options": { "model": "ShopifyProductVariant" }
},
{
"id": "updateExistingShopifyObject",
"if": "!isEmpty(args.input.shopifyProductVariantId) && !isEmpty(args.input.shopifyProductVariant)",
"argsMapping": {
"input.barcode": [
["get", { "path": "args.input.shopifyProductVariant.barcode" }]
],
"input.compareAtPrice": [
[
"get",
{ "path": "args.input.shopifyProductVariant.compareAtPrice" }
]
],
"input.fulfillmentServiceId": [
[
"get",
{
"path": "args.input.shopifyProductVariant.fulfillmentServiceId"
}
]
],
"input.options": [
["get", { "path": "args.input.shopifyProductVariant.options" }]
],
"input.position": [
["get", { "path": "args.input.shopifyProductVariant.position" }]
],
"input.price": [
["get", { "path": "args.input.shopifyProductVariant.price" }]
],
"input.sku": [
["get", { "path": "args.input.shopifyProductVariant.sku" }]
],
"input.taxable": [
["get", { "path": "args.input.shopifyProductVariant.taxable" }]
],
"input.taxCode": [
["get", { "path": "args.input.shopifyProductVariant.taxCode" }]
],
"input.weight": [
["get", { "path": "args.input.shopifyProductVariant.weight" }]
],
"input.weightUnit": [
[
"get",
{ "path": "args.input.shopifyProductVariant.weightUnit" }
]
],
"input.id": [
["get", { "path": "args.input.shopifyProductVariantId" }]
]
},
"name": "graphql:mutation",
"service": "fcommerce-inc",
"options": {
"fieldName": "productVariantUpdate",
"selectionSet": "{ productVariant { id } }"
}
}
],
"resultsMapping": {
"result": [["get", { "path": "steps.editTakeshape.result" }]]
}
},
"description": "Update ShopifyProductVariant. If the input has Shopify values and a Shopify ID, the Shopify productVariant with that ID is updated.\nIf the input has Shopify values and no Shopify ID, a Shopify productVariant is created.",
"args": "UpdateArgs<ShopifyProductVariantInterface>"
},
"createShopifyProductVariant": {
"shape": "CreateResult<ShopifyProductVariant>",
"resolver": {
"compose": [
{
"id": "shopifyCreate",
"if": "!isEmpty(args.input.shopifyProductVariant)",
"argsMapping": {
"input.barcode": [
["get", { "path": "args.input.shopifyProductVariant.barcode" }]
],
"input.compareAtPrice": [
[
"get",
{ "path": "args.input.shopifyProductVariant.compareAtPrice" }
]
],
"input.fulfillmentServiceId": [
[
"get",
{
"path": "args.input.shopifyProductVariant.fulfillmentServiceId"
}
]
],
"input.options": [
["get", { "path": "args.input.shopifyProductVariant.options" }]
],
"input.position": [
["get", { "path": "args.input.shopifyProductVariant.position" }]
],
"input.price": [
["get", { "path": "args.input.shopifyProductVariant.price" }]
],
"input.productId": [
[
"get",
{ "path": "args.input.shopifyProductVariant.productId" }
]
],
"input.sku": [
["get", { "path": "args.input.shopifyProductVariant.sku" }]
],
"input.taxable": [
["get", { "path": "args.input.shopifyProductVariant.taxable" }]
],
"input.taxCode": [
["get", { "path": "args.input.shopifyProductVariant.taxCode" }]
],
"input.weight": [
["get", { "path": "args.input.shopifyProductVariant.weight" }]
],
"input.weightUnit": [
[
"get",
{ "path": "args.input.shopifyProductVariant.weightUnit" }
]
]
},
"name": "graphql:mutation",
"service": "fcommerce-inc",
"options": {
"fieldName": "productVariantCreate",
"selectionSet": "{ productVariant { id } }"
}
},
{
"id": "creatingShopifyObject",
"if": "!isEmpty(args.input.shopifyProductVariant)",
"argsMapping": {
"input": [["get", { "path": "args.input" }]],
"input.shopifyProductVariantId": [
["get", { "path": "steps.shopifyCreate.productVariant.id" }]
]
},
"name": "takeshape:create",
"service": "takeshape:local",
"options": { "model": "ShopifyProductVariant" }
},
{
"id": "notCreatingShopifyObject",
"if": "isEmpty(args.input.shopifyProductVariant)",
"argsMapping": { "input": [["get", { "path": "args.input" }]] },
"name": "takeshape:create",
"service": "takeshape:local",
"options": { "model": "ShopifyProductVariant" }
}
],
"resultsMapping": {
"result": [
["get", { "path": "steps.creatingShopifyObject.result" }],
["get", { "path": "steps.notCreatingShopifyObject.result" }]
]
}
},
"description": "Create ShopifyProductVariant. If Shopify values are provided, a Shopify productVariant is also created and the new productVariant ID is saved.",
"args": "CreateArgs<ShopifyProductVariantInterface>"
},
"duplicateShopifyProductVariant": {
"shape": "DuplicateResult<ShopifyProductVariant>",
"resolver": {
"name": "takeshape:duplicate",
"service": "takeshape:local",
"options": { "model": "ShopifyProductVariant" }
},
"description": "Duplicate ShopifyProductVariant",
"args": "DuplicateArgs<ShopifyProductVariant>"
},
"deleteShopifyProductVariant": {
"shape": "DeleteResult<ShopifyProductVariant>",
"resolver": {
"name": "takeshape:delete",
"service": "takeshape:local",
"options": { "model": "ShopifyProductVariant" }
},
"description": "Delete ShopifyProductVariant",
"args": "DeleteArgs<ShopifyProductVariant>"
},
"updateCollection": {
"shape": "UpdateResult<Collection>",
"resolver": {
"compose": [
{
"id": "createNewShopifyObject",
"if": "isEmpty(args.input.shopifyCollectionId) && !isEmpty(args.input.shopifyCollection)",
"argsMapping": {
"input.descriptionHtml": [
[
"get",
{ "path": "args.input.shopifyCollection.descriptionHtml" }
]
],
"input.handle": [
["get", { "path": "args.input.shopifyCollection.handle" }]
],
"input.templateSuffix": [
[
"get",
{ "path": "args.input.shopifyCollection.templateSuffix" }
]
],
"input.sortOrder": [
["get", { "path": "args.input.shopifyCollection.sortOrder" }]
],
"input.title": [
["get", { "path": "args.input.shopifyCollection.title" }]
],
"input.redirectNewHandle": [
[
"get",
{ "path": "args.input.shopifyCollection.redirectNewHandle" }
]
]
},
"name": "graphql:mutation",
"service": "fcommerce-inc",
"options": {
"fieldName": "collectionCreate",
"selectionSet": "{ collection { id } }"
}
},
{
"id": "editTakeshape",
"argsMapping": {
"input": [["get", { "path": "args.input" }]],
"input.shopifyCollectionId": [
[
"get",
{ "path": "steps.createNewShopifyObject.collection.id" }
],
["get", { "path": "args.input.shopifyCollectionId" }]
]
},
"name": "takeshape:update",
"service": "takeshape:local",
"options": { "model": "Collection" }
},
{
"id": "updateExistingShopifyObject",
"if": "!isEmpty(args.input.shopifyCollectionId) && !isEmpty(args.input.shopifyCollection)",
"argsMapping": {
"input.descriptionHtml": [
[
"get",
{ "path": "args.input.shopifyCollection.descriptionHtml" }
]
],
"input.handle": [
["get", { "path": "args.input.shopifyCollection.handle" }]
],
"input.templateSuffix": [
[
"get",
{ "path": "args.input.shopifyCollection.templateSuffix" }
]
],
"input.sortOrder": [
["get", { "path": "args.input.shopifyCollection.sortOrder" }]
],
"input.title": [
["get", { "path": "args.input.shopifyCollection.title" }]
],
"input.redirectNewHandle": [
[
"get",
{ "path": "args.input.shopifyCollection.redirectNewHandle" }
]
],
"input.id": [
["get", { "path": "args.input.shopifyCollectionId" }]
]
},
"name": "graphql:mutation",
"service": "fcommerce-inc",
"options": {
"fieldName": "collectionUpdate",
"selectionSet": "{ collection { id } }"
}
}
],
"resultsMapping": {
"result": [["get", { "path": "steps.editTakeshape.result" }]]
}
},
"description": "Update Collection. If the input has Shopify values and a Shopify ID, the Shopify collection with that ID is updated.\nIf the input has Shopify values and no Shopify ID, a Shopify collection is created.",
"args": "UpdateArgs<CollectionInterface>"
},
"createCollection": {
"shape": "CreateResult<Collection>",
"resolver": {
"compose": [
{
"id": "shopifyCreate",
"if": "!isEmpty(args.input.shopifyCollection)",
"argsMapping": {
"input.descriptionHtml": [
[
"get",
{ "path": "args.input.shopifyCollection.descriptionHtml" }
]
],
"input.handle": [
["get", { "path": "args.input.shopifyCollection.handle" }]
],
"input.templateSuffix": [
[
"get",
{ "path": "args.input.shopifyCollection.templateSuffix" }
]
],
"input.sortOrder": [
["get", { "path": "args.input.shopifyCollection.sortOrder" }]
],
"input.title": [
["get", { "path": "args.input.shopifyCollection.title" }]
],
"input.redirectNewHandle": [
[
"get",
{ "path": "args.input.shopifyCollection.redirectNewHandle" }
]
]
},
"name": "graphql:mutation",
"service": "fcommerce-inc",
"options": {
"fieldName": "collectionCreate",
"selectionSet": "{ collection { id } }"
}
},
{
"id": "creatingShopifyObject",
"if": "!isEmpty(args.input.shopifyCollection)",
"argsMapping": {
"input": [["get", { "path": "args.input" }]],
"input.shopifyCollectionId": [
["get", { "path": "steps.shopifyCreate.collection.id" }]
]
},
"name": "takeshape:create",
"service": "takeshape:local",
"options": { "model": "Collection" }
},
{
"id": "notCreatingShopifyObject",
"if": "isEmpty(args.input.shopifyCollection)",
"argsMapping": { "input": [["get", { "path": "args.input" }]] },
"name": "takeshape:create",
"service": "takeshape:local",
"options": { "model": "Collection" }
}
],
"resultsMapping": {
"result": [
["get", { "path": "steps.creatingShopifyObject.result" }],
["get", { "path": "steps.notCreatingShopifyObject.result" }]
]
}
},
"description": "Create Collection. If Shopify values are provided, a Shopify collection is also created and the new collection ID is saved.",
"args": "CreateArgs<CollectionInterface>"
},
"duplicateCollection": {
"shape": "DuplicateResult<Collection>",
"resolver": {
"name": "takeshape:duplicate",
"service": "takeshape:local",
"options": { "model": "Collection" }
},
"description": "Duplicate Collection",
"args": "DuplicateArgs<Collection>"
},
"deleteCollection": {
"shape": "DeleteResult<Collection>",
"resolver": {
"name": "takeshape:delete",
"service": "takeshape:local",
"options": { "model": "Collection" }
},
"description": "Delete Collection",
"args": "DeleteArgs<Collection>"
}
},
"shapes": {
"SProduct": {
"id": "SProduct",
"name": "SProduct",
"title": "SProduct",
"schema": {
"type": "object",
"properties": {
"sku": { "type": "string" },
"type": { "type": "string" },
"status": { "type": "string" },
"createdOn": { "type": "string" }
}
}
},
"Product": {
"id": "Product",
"name": "Product",
"title": "Product",
"schema": {
"type": "object",
"properties": {
"itemId": { "type": "string", "title": "itemId" },
"sku": { "type": "string" },
"children": {
"items": { "$ref": "#/shapes/Children/schema" },
"type": "array"
},
"description": { "type": "string" },
"type": { "type": "string" },
"status": { "type": "string" },
"bundleItems": { "type": "array" },
"categories": {
"items": { "$ref": "#/shapes/Categories/schema" },
"type": "array"
},
"attributes": {
"items": { "$ref": "#/shapes/ProductAttributes/schema" },
"type": "array"
},
"createdOn": { "type": "string" },
"modifiedOn": { "type": "string" },
"price": {
"$ref": "#/shapes/Price/schema",
"type": "object",
"title": "Price",
"description": "Returns Price",
"@resolver": {
"resultsMapping": [["get", { "path": "steps[0][0]" }]],
"name": "rest:post",
"service": "price",
"options": { "path": "/offer/get-by-itemIds" },
"argsMapping": {
"body": [
[
"expressionEval",
{ "expression": "'{\"itemIds\":[' + source.itemId +']}'" }
]
]
}
}
},
"inventory": {
"$ref": "#/shapes/Inventory/schema",
"type": "object",
"title": "Inventory",
"description": "Returns Inventory",
"@resolver": {
"resultsMapping": [["get", { "path": "steps[0][0]" }]],
"name": "rest:post",
"service": "inventory",
"options": { "path": "/inventory" },
"argsMapping": {
"body": [
[
"expressionEval",
{
"expression": "'{\"items\":[{ \"itemId\":' + source.itemId + ', \"quantity\": 1}], \"channelId\": 12 }'"
}
]
]
}
}
}
}
}
},
"CategoryTree": {
"id": "CategoryTree",
"name": "CategoryTree",
"title": "CategoryTree",
"schema": {
"type": "object",
"properties": {
"id": { "type": "string" },
"name": { "type": "string" }
}
}
},
"ProductDetailsInput": {
"id": "ProductDetailsInput",
"name": "ProductDetailsInput",
"title": "ProductDetailsInput",
"schema": {
"type": "object",
"properties": {
"input": {
"type": "object",
"properties": { "sku": { "type": "string" } }
}
},
"required": ["input"]
}
},
"ShopifyProductDetailsInput": {
"id": "ShopifyProductDetailsInput",
"name": "ShopifyProductDetailsInput",
"title": "ShopifyProductDetailsInput",
"schema": {
"type": "object",
"properties": { "id": { "type": "string" } },
"required": ["id"]
}
},
"CategoryTreeArgs": {
"id": "CategoryTreeArgs",
"name": "CategoryTreeArgs",
"title": "CategoryTreeArgs",
"schema": {
"type": "object",
"properties": { "id": { "type": "string" } },
"required": ["id"]
}
},
"InventoryArgs": {
"id": "inventory-args-id",
"name": "InventoryArgs",
"title": "InventoryArgs",
"schema": {
"type": "object",
"properties": {
"itemId": { "type": "string", "title": "Items Id" },
"payload": { "type": "object" }
}
}
},
"PriceArgs": {
"id": "price-args-id",
"name": "PriceArgs",
"title": "PriceArgs",
"schema": {
"type": "object",
"properties": { "payload": { "type": "object" } }
}
},
"ItemProductArgs": {
"id": "item-args-id",
"name": "ItemProductArgs",
"title": "ItemProductArgs",
"schema": {
"type": "object",
"properties": {
"itemIds": { "type": "string", "title": "Items Ids" },
"page": { "type": "string", "title": "Page" },
"size": { "type": "string", "title": "size" }
}
}
},
"ItemProduct": {
"id": "item-id",
"name": "ItemProduct",
"title": "ItemProduct",
"schema": {
"type": "object",
"properties": {
"pageSize": { "type": "number" },
"totalSize": { "type": "number" },
"pages": { "type": "number" },
"products": {
"items": { "$ref": "#/shapes/IProducts/schema" },
"type": "array"
}
}
}
},
"ItemProductFilter": {
"id": "item-filter-id",
"name": "ItemProductFilter",
"title": "ItemProductFilter",
"schema": {
"type": "object",
"properties": {
"pageSize": { "type": "number" },
"totalSize": { "type": "number" },
"pages": { "type": "number" },
"products": {
"items": { "$ref": "#/shapes/IProductsFilter/schema" },
"type": "array"
}
}
}
},
"IProducts": {
"id": "product-id",
"name": "IProducts",
"title": "IProducts",
"schema": {
"type": "object",
"properties": {
"sku": { "type": "string" },
"itemId": { "type": "number" },
"children": {
"items": { "$ref": "#/shapes/Children/schema" },
"type": "array"
},
"type": { "type": "string" },
"status": { "type": "string" },
"bundleItems": { "type": "array" },
"categories": {
"items": { "$ref": "#/shapes/Categories/schema" },
"type": "array"
},
"attributes": {
"items": { "$ref": "#/shapes/ProductAttributes/schema" },
"type": "array"
},
"createdOn": { "type": "string" },
"modifiedOn": { "type": "string" }
}
}
},
"IProductsFilter": {
"id": "product-filter-id",
"name": "IProductsFilter",
"title": "IProductsFilter",
"schema": {
"type": "object",
"properties": {
"sku": { "type": "string" },
"itemId": { "type": "number" },
"children": {
"items": { "$ref": "#/shapes/Children/schema" },
"type": "array"
},
"type": { "type": "string" },
"status": { "type": "string" },
"bundleItems": { "type": "array" },
"categories": {
"items": { "$ref": "#/shapes/Categories/schema" },
"type": "array"
},
"attributes": { "$ref": "#/shapes/ProductAttributesFilter/schema" },
"createdOn": { "type": "string" },
"modifiedOn": { "type": "string" }
}
}
},
"Children": {
"id": "children-id",
"name": "Children",
"title": "Children",
"schema": {
"type": "object",
"properties": {
"sku": { "type": "string" },
"attributes": {
"items": { "$ref": "#/shapes/ProductAttributes/schema" },
"type": "array"
},
"price": {
"$ref": "#/shapes/Price/schema",
"type": "object",
"title": "Price",
"description": "Returns Price",
"@resolver": {
"resultsMapping": [["get", { "path": "steps[0][0]" }]],
"name": "rest:post",
"service": "price",
"options": { "path": "/offer/get-by-itemIds" },
"argsMapping": {
"body": [
[
"expressionEval",
{ "expression": "'{\"itemIds\":[' + source.itemId +']}'" }
]
]
}
}
},
"inventory": {
"$ref": "#/shapes/Inventory/schema",
"type": "object",
"title": "Inventory",
"description": "Returns Inventory",
"@resolver": {
"resultsMapping": [["get", { "path": "steps[0][0]" }]],
"name": "rest:post",
"service": "inventory",
"options": { "path": "/inventory" },
"argsMapping": {
"body": [
[
"expressionEval",
{
"expression": "'{\"items\":[{ \"itemId\":' + source.itemId + ', \"quantity\": 1}], \"channelId\": 12 }'"
}
]
]
}
}
}
}
}
},
"Categories": {
"id": "categories-id",
"name": "Categories",
"title": "Categories",
"schema": {
"type": "object",
"properties": {
"id": { "type": "string" },
"name": { "type": "string" },
"breadcrumbs": {
"items": { "$ref": "#/shapes/Breadcrumbs/schema" },
"type": "array"
},
"attributes": { "type": "array" }
}
}
},
"Breadcrumbs": {
"id": "breadcrumb-id",
"name": "Breadcrumbs",
"title": "Breadcrumbs",
"schema": {
"type": "object",
"properties": {
"id": { "type": "string" },
"name": { "type": "string" },
"attributes": { "type": "array" }
}
}
},
"ProductAttributes": {
"id": "attribute-id",
"name": "ProductAttributes",
"title": "ProductAttributes",
"schema": {
"type": "object",
"properties": {
"name": { "type": "string" },
"description": { "type": "string" },
"type": { "type": "string" },
"value": { "type": "string" }
}
}
},
"ProductAttributesFilter": {
"id": "attribute-filter-id",
"name": "ProductAttributesFilter",
"title": "ProductAttributesFilter",
"schema": {
"type": "object",
"properties": {
"productTitle": { "type": "string" },
"productImage": { "type": "string" },
"active": { "type": "string" },
"shortDescription": { "type": "string" },
"finalSale": { "type": "string" },
"length": { "type": "string" },
"weight": { "type": "string" },
"productIdNew": { "type": "string" },
"starch": { "type": "string" },
"createdDate1": { "type": "string" },
"starchAttribute": { "type": "string" },
"protein": { "type": "string" },
"productVariant": { "type": "string" },
"text2": { "type": "string" },
"textTesting": { "type": "string" },
"lov": { "type": "string" },
"color": { "type": "string" },
"test1": { "type": "string" },
"brand1": { "type": "string" },
"brand": { "type": "string" },
"size": { "type": "string" },
"description": { "type": "string" },
"sizeNumeric": { "type": "string" },
"taxCode": { "type": "string" },
"test22": { "type": "string" }
}
}
},
"GenericInventory": {
"id": "generic-inventory-id",
"name": "GenericInventory",
"title": "GenericInventory",
"schema": {
"type": "object",
"properties": {
"_id": { "type": "string" },
"itemId": { "type": "number" },
"inlocations": {
"items": { "$ref": "#/shapes/InLocations/schema" },
"type": "array"
},
"createdAt": { "type": "string" },
"updatedAt": { "type": "string" }
}
}
},
"InLocations": {
"id": "inlocations-id",
"name": "InLocations",
"title": "InLocations",
"schema": {
"type": "object",
"properties": {
"_id": { "type": "string" },
"location": {
"type": "array",
"items": { "$ref": "#/shapes/Location/schema" }
},
"inStock": { "type": "number" },
"channel": {
"type": "array",
"items": { "$ref": "#/shapes/Channel/schema" }
},
"inTransit": { "type": "array" },
"id": { "type": "string" }
}
}
},
"Location": {
"id": "location-id",
"name": "Location",
"title": "Location",
"schema": {
"type": "object",
"properties": {
"_id": { "type": "string" },
"channel": { "type": "array" },
"isActive": { "type": "string" },
"name": { "type": "string" },
"address": { "$ref": "#/shapes/Address/schema" },
"kind": { "type": "string" },
"locationId": { "type": "number" },
"pickup": { "type": "string" },
"createdAt": { "type": "string" },
"updatedAt": { "type": "string" },
"type": { "type": "string" },
"coordinates": { "$ref": "#/shapes/Coordinates/schema" }
}
}
},
"Address": {
"id": "address-id",
"name": "Address",
"title": "Address",
"schema": {
"type": "object",
"properties": {
"street1": { "type": "string" },
"city": { "type": "string" },
"state": { "type": "string" },
"country": { "type": "string" },
"zipCode": { "type": "string" }
}
}
},
"Coordinates": {
"id": "coordinates-id",
"name": "Coordinates",
"title": "Coordinates",
"schema": {
"type": "object",
"properties": {
"latitude": { "type": "number" },
"longitude": { "type": "number" }
}
}
},
"Channel": {
"id": "channel-id",
"name": "Channel",
"title": "Channel",
"schema": {
"type": "object",
"properties": {
"quantityReserved": { "type": "number" },
"_id": { "type": "string" },
"channelId": { "type": "number" },
"allocation": { "$ref": "#/shapes/Allocation/schema" },
"id": { "type": "string" }
}
}
},
"Allocation": {
"id": "allocation-id",
"name": "Allocation",
"title": "Allocation",
"schema": {
"type": "object",
"properties": {
"mou": { "type": "string" },
"unit": { "type": "number" }
}
}
},
"Inventory": {
"id": "inventory-id",
"name": "Inventory",
"title": "Inventory",
"schema": {
"type": "object",
"properties": {
"itemId": { "type": "number" },
"quantityRequested": { "type": "number" },
"stockDate": { "type": "string" },
"inStock": { "type": "boolean" },
"fromStockQuantity": { "type": "number" },
"fromStock": {
"items": { "$ref": "#/shapes/FromStock/schema" },
"type": "array"
},
"fromTransitQuantity": { "type": "number" },
"fromTransit": { "type": "array" },
"availableStockQuantity": { "type": "number" },
"availableTransitQuantity": { "type": "number" },
"availableTotal": { "type": "number" }
}
}
},
"FromStock": {
"id": "stock-id",
"name": "FromStock",
"title": "FromStock",
"schema": {
"type": "object",
"properties": {
"locationId": { "type": "string" },
"quantityReserved": { "type": "number" },
"quantityAllocated": { "type": "number" },
"stockRemaining": { "type": "number" },
"stockRequest": { "type": "number" },
"channelId": { "type": "number" }
}
}
},
"Price": {
"id": "price-id",
"name": "Price",
"title": "Price",
"schema": {
"type": "object",
"properties": {
"_id": { "type": "string" },
"isSoftDeleted": { "type": "string" },
"priceListId": { "type": "number" },
"itemId": { "type": "number" },
"offers": {
"items": { "$ref": "#/shapes/Offers/schema" },
"type": "array"
}
}
}
},
"Offers": {
"id": "offer-id",
"name": "Offers",
"title": "Offers",
"schema": {
"type": "object",
"properties": {
"price": {
"items": { "$ref": "#/shapes/OfferPrice/schema" },
"type": "array"
},
"_id": { "type": "string" },
"kind": { "type": "string" },
"startDate": { "type": "string" },
"endDate": { "type": "string" },
"offerCode": { "type": "number" }
}
}
},
"OfferPrice": {
"id": "offer-price-id",
"name": "OfferPrice",
"title": "OfferPrice",
"schema": {
"type": "object",
"properties": {
"sale": { "type": "number" },
"cost": { "type": "number" },
"base": { "type": "number" },
"currency": { "type": "string" }
}
}
},
"CartInitArgs": {
"id": "cart-init",
"name": "CartInitArgs",
"title": "Input for cart init api",
"schema": {
"type": "object",
"properties": {
"payload": { "type": "object", "title": "parameter for cart api" }
}
}
},
"CartInitShape": {
"id": "cart-init-id",
"name": "CartInitShape",
"title": "some shape for cart",
"schema": {
"type": "object",
"properties": {
"message": { "type": "string", "title": "output string" }
}
}
},
"StoreArgs": {
"id": "store-id",
"name": "StoreArgs",
"title": "Input for store api",
"schema": {
"type": "object",
"properties": {
"payload": {
"type": "object",
"title": "name parameter for store api"
}
}
}
},
"StoreShape": {
"id": "store-shape-id",
"name": "StoreShape",
"title": "StoreShapeId",
"schema": {
"type": "object",
"properties": {
"message": { "type": "string", "title": "Message output" }
}
}
},
"ShopifyProductInterface": {
"id": "ShopifyProductInterface",
"name": "ShopifyProductInterface",
"title": "ShopifyProductInterface",
"description": "ShopifyProductInterface",
"schema": {
"type": "object",
"properties": {
"_id": { "type": "string" },
"_version": { "type": "number" },
"_status": { "type": "string", "@workflow": "default" },
"name": {
"title": "Name",
"type": "string",
"description": "Initialized with title from shopify"
},
"shopifyProductId": { "title": "Service ID", "type": "string" },
"shopifyProduct": { "@ref": "fcommerce-inc:ProductInput" }
},
"required": []
}
},
"ShopifyProduct": {
"name": "ShopifyProduct",
"id": "3f10O9dci",
"title": "ShopifyProduct",
"workflow": "default",
"model": { "type": "multiple" },
"schema": {
"type": "object",
"properties": {
"name": {
"title": "Name",
"type": "string",
"description": "Initialized with title from shopify",
"@mapping": "takeshape:local:ShopifyProduct.i-PG9JakbQ"
},
"shopifyProduct": {
"@ref": "fcommerce-inc:Product",
"@resolver": {
"name": "graphql:query",
"service": "fcommerce-inc",
"options": { "fieldName": "product" },
"argsMapping": {
"id": [["get", { "path": "source.shopifyProductId" }]]
}
},
"@tag": "pattern:service-object:1"
},
"attributes": {
"items": { "$ref": "#/shapes/ProductAttributes/schema" },
"type": "array",
"@resolver": {
"resultsMapping": [
[
"expressionEval",
{
"expression": "map(compose(map(compose(compose(zipObject(['description', 'id', 'name', 'namespace', 'type', 'value']), map(get('[1]'))), sortBy('[0]'), toPairs, get('node'))), get('metafields.edges')), get('data.getShopifyProductList.items', steps[0]))"
}
]
],
"name": "graphql:query",
"service": "fcommerce-inc",
"options": {
"fieldName": "product",
"selectionSet": "{ metafields(first: 10) { edges { node { id namespace ownerType value description key } } } }"
},
"argsMapping": {
"id": [["get", { "path": "source.shopifyProductId" }]]
}
}
},
"shopifyProductId": {
"type": "string",
"@mapping": "takeshape:local:ShopifyProduct.shopifyProductId",
"title": "shopify product",
"minLength": 1
}
}
}
},
"ShopifyProductVariantInterface": {
"id": "ShopifyProductVariantInterface",
"name": "ShopifyProductVariantInterface",
"title": "ShopifyProductVariantInterface",
"description": "ShopifyProductVariantInterface",
"schema": {
"type": "object",
"properties": {
"_id": { "type": "string" },
"_version": { "type": "number" },
"_status": { "type": "string", "@workflow": "default" },
"name": {
"title": "Name",
"type": "string",
"description": "Initialized with title from shopify"
},
"shopifyProductVariantId": {
"title": "Service ID",
"type": "string"
},
"shopifyProductVariant": {
"@ref": "fcommerce-inc:ProductVariantInput"
}
},
"required": []
}
},
"ShopifyProductVariant": {
"name": "ShopifyProductVariant",
"id": "bEc6HS-J5",
"title": "ShopifyProductVariant",
"workflow": "default",
"model": { "type": "multiple" },
"schema": {
"type": "object",
"properties": {
"name": {
"title": "Name",
"type": "string",
"description": "Initialized with title from shopify",
"@mapping": "takeshape:local:ShopifyProductVariant.RKrQzN70rV"
},
"shopifyProductVariant": {
"@ref": "fcommerce-inc:ProductVariant",
"@resolver": {
"name": "graphql:query",
"service": "fcommerce-inc",
"options": { "fieldName": "productVariant" },
"argsMapping": {
"id": [["get", { "path": "source.shopifyProductVariantId" }]]
}
},
"@tag": "pattern:service-object:1"
},
"shopifyProductVariantId": {
"type": "string",
"@mapping": "takeshape:local:ShopifyProductVariant.shopifyProductVariantId",
"title": "shopify productVariant",
"minLength": 1,
"pattern": "(^gid://shopify/ProductVariant/\\d+$)"
}
}
}
},
"CollectionInterface": {
"id": "CollectionInterface",
"name": "CollectionInterface",
"title": "CollectionInterface",
"description": "CollectionInterface",
"schema": {
"type": "object",
"properties": {
"_id": { "type": "string" },
"_version": { "type": "number" },
"_status": { "type": "string", "@workflow": "default" },
"name": {
"title": "Name",
"type": "string",
"description": "Initialized with title from shopify"
},
"shopifyCollectionId": { "title": "Service ID", "type": "string" },
"shopifyCollection": { "@ref": "fcommerce-inc:CollectionInput" }
},
"required": []
}
},
"Collection": {
"name": "Collection",
"id": "l6V1in_hM",
"title": "Collection",
"workflow": "default",
"model": { "type": "multiple" },
"schema": {
"type": "object",
"properties": {
"name": {
"title": "Name",
"type": "string",
"description": "Initialized with title from shopify",
"@mapping": "takeshape:local:Collection.stK4JweBbc"
},
"shopifyCollection": {
"@ref": "fcommerce-inc:Collection",
"@resolver": {
"name": "graphql:query",
"service": "fcommerce-inc",
"options": { "fieldName": "collection" },
"argsMapping": {
"id": [["get", { "path": "source.shopifyCollectionId" }]]
}
},
"@tag": "pattern:service-object:1"
},
"shopifyCollectionId": {
"type": "string",
"@mapping": "takeshape:local:Collection.shopifyCollectionId",
"title": "shopify collection",
"minLength": 1,
"pattern": "(^gid://shopify/Collection/\\d+$)"
}
}
}
}
},
"workflows": {},
"forms": {
"ShopifyProduct": {
"default": {
"properties": {
"name": { "widget": "singleLineText" },
"shopifyProduct": {
"properties": {
"descriptionHtml": {
"widget": "serviceObjectProperty",
"provider": "shopify"
},
"handle": {
"widget": "serviceObjectProperty",
"provider": "shopify"
},
"redirectNewHandle": {
"widget": "serviceObjectProperty",
"provider": "shopify"
},
"productType": {
"widget": "serviceObjectProperty",
"provider": "shopify"
},
"tags": {
"widget": "serviceObjectProperty",
"provider": "shopify"
},
"templateSuffix": {
"widget": "serviceObjectProperty",
"provider": "shopify"
},
"giftCard": {
"widget": "serviceObjectProperty",
"provider": "shopify"
},
"giftCardTemplateSuffix": {
"widget": "serviceObjectProperty",
"provider": "shopify"
},
"title": {
"widget": "serviceObjectProperty",
"provider": "shopify"
},
"vendor": {
"widget": "serviceObjectProperty",
"provider": "shopify"
},
"bodyHtml": {
"widget": "serviceObjectProperty",
"provider": "shopify"
},
"images": {
"widget": "shopifyProductImages",
"provider": "shopify"
},
"publishedAt": {
"widget": "serviceObjectProperty",
"provider": "shopify"
},
"variants": {
"widget": "shopifyRelationshipSummary",
"provider": "shopify"
}
},
"widget": "shopify",
"wrapper": "shopifyServiceWrapper",
"order": [
"title",
"handle",
"descriptionHtml",
"bodyHtml",
"tags",
"vendor",
"publishedAt",
"variants",
"images",
"redirectNewHandle",
"productType",
"templateSuffix",
"giftCard",
"giftCardTemplateSuffix"
]
},
"shopifyProductId": {
"instructions": "Format: gid://shopify/Product/1111111111111",
"label": "product ID",
"widget": "serviceObjectId",
"provider": "shopify",
"serviceObjectType": "product",
"service": "fcommerce-inc"
}
},
"order": ["name", "shopifyProductId", "shopifyProduct"]
}
},
"ShopifyProductVariant": {
"default": {
"properties": {
"name": { "widget": "singleLineText" },
"shopifyProductVariant": {
"properties": {
"barcode": {
"widget": "serviceObjectProperty",
"provider": "shopify"
},
"compareAtPrice": {
"widget": "serviceObjectProperty",
"provider": "shopify"
},
"fulfillmentServiceId": {
"widget": "serviceObjectProperty",
"provider": "shopify"
},
"options": {
"widget": "serviceObjectProperty",
"provider": "shopify"
},
"position": {
"widget": "serviceObjectProperty",
"provider": "shopify"
},
"price": {
"widget": "serviceObjectProperty",
"provider": "shopify"
},
"productId": {
"widget": "serviceObjectProperty",
"provider": "shopify"
},
"sku": {
"widget": "serviceObjectProperty",
"provider": "shopify"
},
"taxable": {
"widget": "serviceObjectProperty",
"provider": "shopify"
},
"title": {
"widget": "serviceObjectProperty",
"provider": "shopify"
},
"taxCode": {
"widget": "serviceObjectProperty",
"provider": "shopify"
},
"weight": {
"widget": "serviceObjectProperty",
"provider": "shopify"
},
"weightUnit": {
"widget": "serviceObjectProperty",
"provider": "shopify"
},
"image": {
"widget": "shopifyCollectionImage",
"provider": "shopify"
}
},
"widget": "shopify",
"wrapper": "shopifyServiceWrapper",
"order": [
"title",
"productId",
"options",
"barcode",
"sku",
"price",
"compareAtPrice",
"image",
"fulfillmentServiceId",
"position",
"taxable",
"taxCode",
"weight",
"weightUnit"
]
},
"shopifyProductVariantId": {
"instructions": "Format: gid://shopify/ProductVariant/1111111111111",
"label": "productVariant ID",
"widget": "serviceObjectId",
"provider": "shopify",
"serviceObjectType": "productVariant",
"service": "fcommerce-inc"
}
},
"order": ["name", "shopifyProductVariantId", "shopifyProductVariant"]
}
},
"Collection": {
"default": {
"properties": {
"name": { "widget": "singleLineText" },
"shopifyCollection": {
"properties": {
"descriptionHtml": {
"widget": "serviceObjectProperty",
"provider": "shopify"
},
"handle": {
"widget": "serviceObjectProperty",
"provider": "shopify"
},
"image": {
"widget": "shopifyCollectionImage",
"provider": "shopify"
},
"products": {
"widget": "shopifyRelationshipSummary",
"provider": "shopify"
},
"templateSuffix": {
"widget": "serviceObjectProperty",
"provider": "shopify"
},
"sortOrder": {
"widget": "serviceObjectProperty",
"provider": "shopify"
},
"title": {
"widget": "serviceObjectProperty",
"provider": "shopify"
},
"redirectNewHandle": {
"widget": "serviceObjectProperty",
"provider": "shopify"
}
},
"widget": "shopify",
"wrapper": "shopifyServiceWrapper",
"order": [
"title",
"handle",
"descriptionHtml",
"products",
"image",
"templateSuffix",
"sortOrder",
"redirectNewHandle"
]
},
"shopifyCollectionId": {
"instructions": "Format: gid://shopify/Collection/1111111111111",
"label": "collection ID",
"widget": "serviceObjectId",
"provider": "shopify",
"serviceObjectType": "collection",
"service": "fcommerce-inc"
}
},
"order": ["name", "shopifyCollectionId", "shopifyCollection"]
}
}
},
"services": {
"pim": {
"id": "pim",
"provider": "generic",
"title": "pimv2",
"namespace": "PIM",
"serviceType": "rest",
"authenticationType": "none",
"options": {
"headers": {
"x-site-context": "{\"date\":\"2021-08-09T15:17:33.500Z\",\"channel\":12,\"account\":\"60b910a9b9d1b20008fae769\", \"stage\":\"sandbox\"}"
},
"endpoint": "https://sandbox.copilot.fabric.inc/api-product/"
}
},
"inventory": {
"id": "inventory",
"provider": "generic",
"title": "Inventory",
"namespace": "Inventory",
"serviceType": "rest",
"authenticationType": "none",
"options": {
"headers": {
"x-site-context": "{\"date\":\"2021-08-09T15:17:33.500Z\",\"channel\":12,\"account\":\"60b910a9b9d1b20008fae769\", \"stage\":\"sandbox\"}"
},
"endpoint": "https://uat01-apigw.refstorefrontdev.fabric.zone/api-inventory/"
}
},
"price": {
"id": "price",
"provider": "generic",
"title": "Price",
"namespace": "Price",
"serviceType": "rest",
"authenticationType": "none",
"options": {
"headers": {
"x-site-context": "{\"date\":\"2021-09-21T15:29:29.356Z\",\"channel\":12,\"account\":\"60b910a9b9d1b20008fae769\", \"stage\":\"sandbox\"}"
},
"endpoint": "https://uat01-apigw.refstorefrontdev.fabric.zone/api-price/"
}
},
"cart-init": {
"id": "cart-init",
"provider": "generic",
"title": "Cart-Init",
"namespace": "CartInit",
"serviceType": "rest",
"authenticationType": "none",
"options": { "endpoint": "https://cart.dev.cart.fabric.inc" }
},
"store-api-hw": {
"id": "store-api-hw",
"provider": "generic",
"title": "Store-api-hw",
"namespace": "StoreHW",
"serviceType": "rest",
"authenticationType": "none",
"options": { "endpoint": "https://store-api.qa.storefront.fabric.inc" }
},
"copilot-layer": {
"id": "copilot-layer",
"provider": "generic",
"title": "copilot-layer",
"namespace": "CopilotLayer",
"serviceType": "rest",
"authenticationType": "none",
"options": {
"headers": {
"x-site-context": "{\"date\":\"2021-08-09T15:17:33.500Z\",\"channel\":12,\"account\":\"60b910a9b9d1b20008fae769\", \"stage\":\"sandbox\"}"
},
"endpoint": "https://sandbox.copilot.fabric.inc"
}
},
"fcommerce-inc": {
"title": "fcommerce",
"namespace": "Shopify",
"provider": "shopify",
"serviceType": "graphql",
"authenticationType": "oauth2Bearer",
"authentication": "AdSNQGk2CZ9btSn9Y26V9IWjOO04R1c5/Piur0sVCqfU7cEM3UQF/j65ORbsi7UUw9IysSME1sOgIdpkaB45/wVhJEE6AJE9wb0Tr1DnvuY31sARktFYI1bV5zGiIFLrVbZY8438pzZ0KBBw/Tb4Qb8rTrAnfdIM+NuqD3UxfhdTUFmK3nvRFTCtbTDTd1vwOXdu",
"options": {
"shop": "fcommerce-inc",
"endpoint": "https://fcommerce-inc.myshopify.com/admin/api/2020-07/graphql.json"
},
"id": "fcommerce-inc"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment