priceList GraphQL request returns items not in the list

I’m playing around with the B2B functionality and ran across an issue I can’t seem to find an answer for. I’ve created a single catalog with a single products list with three items on the list.

When I query the price list it using the priceList GraphQL endpoint it does not return the three products. It returns all products.

Any idea what I am missing here?

query MyQuery {
  priceList(id: "gid://shopify/PriceList/23714594997") {
    name
    prices(first: 5) {
      nodes {
        price {
          amount
        }
        compareAtPrice {
          amount
        }
      }
    }
  }
}``` 


{
  "data": {
    "priceList": {
      "name": "Test Catalog - d989b260-bcb6-496f-bbac-4d1e40b58d06",
      "prices": {
        "nodes": [
          {
            "price": {
              "amount": "1325.0"
            },
            "compareAtPrice": null
          },
          {
            "price": {
              "amount": "75.0"
            },
            "compareAtPrice": null
          },
          {
            "price": {
              "amount": "121.0"
            },
            "compareAtPrice": null
          },
          {
            "price": {
              "amount": "245.0"
            },
            "compareAtPrice": null
          },
          {
            "price": {
              "amount": "750.0"
            },
            "compareAtPrice": null
          }
        ]
      }
    }
  },
  "extensions": {
    "cost": {
      "requestedQueryCost": 6,
      "actualQueryCost": 6,
      "throttleStatus": {
        "maximumAvailable": 20000,
        "currentlyAvailable": 19994,
        "restoreRate": 1000
      }
    }
  }
}
1 Like

Hey @Timothy_Blevins,

The price list query looks to be working as expected. When you query a price list, it returns all products with their prices, not just the ones in your specific product list. This is because price lists are designed to provide pricing information for all products, whether they’re adjusted by percentage or have fixed prices set.

One way to get only the products in your specific catalog is by using the products query with a filter for your catalog publication. The key is to use the contextualPricing field in your query, which allows you to get prices for products based on a specific company location.

I get what you are saying, and it will work for me, but doesn’t it make more sense that a price list only return prices in that list? Price lists have to be created and prices need to be added so it feels like you should be able to query the prices you added to the list. Just a thought.