Functions - where to get cart properties available?

mmlacabra
Shopify Partner
7 0 3

I am new to graphql and i dont understand where on earth I can find out which properties and subproperties are available in a given object. 

 

for example

 

query Input {
  cart {
    buyerIdentity {
      customer {
        numberOfOrders
      }
    }
    cost {
      subtotalAmount {
        amount
      }
    }
    lines {
      id
      # cost
      merchandise {
        title
        weight
      }
      quantity
    }
  }
}

Merchandise says it has a CustomProduct but the docs don't give you what the variable is actually called. I thought maybe to add it without the product but it's not working. It does not seem very straightforward.

 

Can anyone help?

Reply 1 (1)

infinite_loop
Shopify Partner
4 0 0

Here you go:

query Input {
  cart {
    buyerIdentity {
      customer {
        numberOfOrders
      }
    }
    cost {
      subtotalAmount {
        amount
      }
    }
    lines {
      id
      attribute(key: "myCustomKey") {
        key
        value
      }
      # cost
      merchandise {
        title
        weight
      }
      quantity
    }
  }
}