Bug in Admin GraphQL API: publishedInContext

angpro
Shopify Partner
10 1 1

Hi,

 

Looks like I have discovered a bug in ProductVariants - Product - publishedInContext endpoint, please correct me if I am wrong.

 

Let's consider a scenario for B2B store, when a product is not published on Online Store (but Active). And this product is in a catalog "Test Catalog":

CleanShot 2024-05-10 at 18.35.40@2x.png

 

Then we assign this catalog to a Company Location "Test Location":

CleanShot 2024-05-10 at 18.38.42@2x.png

 

 

We assume that for a B2B customer ordering for the location "Test Location" that product is available, even though the product may be not published on the Online Store. The Catalog "Test Catalog" overwrites rules.

 

And it works like expected when I try to search the product on the Online Store itself as logged in B2B customer ordering for that Location.

 

Now I want to get publishedInContext using Admin GraphQL API:

 

 

 

 

publishedInContext(
           context: { companyLocationId: "gid://shopify/CompanyLocation/[ID]" }

 

 

 

 

 

 

Here are results I got when testing, in both tests the product in the "Test Catalog" and not published on Online Store.

 

1 - the "Test Catalog" is assigned to the Company Location "Test Location":

* publishedInContext = true

The product can be found on the Online Store.

 

2 - the "Test Catalog" is NOT assigned to the Company Location "Test Location":

* publishedInContext = true

The product can NOT be found on the Online Store.

 

As you can see in the second test the publishedInContext is expected to be false.

 

Would very much appreciate any help! 

 

 

 

 

====

Actually I am using:

 

 

 

 

publishedInContext(
           context: { companyLocationId: "gid://shopify/CompanyLocation/[ID]", country: [current_location_shipping_address_country_code] }

 

 

 

 

But for this query it does not work as well.

 

 

Replies 0 (0)