Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Retrieving sales channel names from product publications resource

Retrieving sales channel names from product publications resource

tvh
Shopify Partner
1 0 4

I am trying to retrieve a complete list of sales channels when querying for individual products including the name of the sales channel. I can retrieve the list of sales channels with the following connections: 

Product->ResourcePublication->Publication

Product->ResourcePublicationV2->Publication

 

Currently I can get the name and id of a channel on the Publications type, however the `name` field has been deprecated. The docs suggest using Catalog.title as a replacement, however requesting catalog field on publication returns nil for catalog on each channel, and as a result there is no title returned either. 

 

Below is an example query body I have written in Ruby and the response that I receive. 

request:

        <<~QUERY
          query {
            product(id: "gid://shopify/Product/#{shopify_product_id}") {
              resourcePublications(first: 15){
                edges{
                  node{
                    publication{
                      name
                      id
                      catalog{
                        title
                      }
                    }
                  }
                }
              }
            }
          }
        QUERY

response: 

=> #<ShopifyAPI::Clients::HttpResponse:{redacted}
 @body=
  {"data"=>
    {"product"=>
      {"resourcePublications"=>
        {"edges"=>
          [{"node"=>{"publication"=>{"name"=>"Online Store", "id"=>"gid://shopify/Publication/{redacted}", "catalog"=>nil}}},
           {"node"=>{"publication"=>{"name"=>"Old Sandbox", "id"=>"gid://shopify/Publication/{redacted}", "catalog"=>nil}}}]}}},
   "extensions"=>{"cost"=>{"requestedQueryCost"=>48, "actualQueryCost"=>9, "throttleStatus"=>{"maximumAvailable"=>1000.0, "currentlyAvailable"=>991, "restoreRate"=>50.0}}}},
 @CODE=200,

 

See `"catalog"=>nil` for each `publication` above. 
I believe the response I am getting is correct, meaning there should not be any catalogs because I've never setup or seen 'catalogs' in the store (I use the default dev store setup w/ snowboard product data and don't mess with it after that).

Is there a different way to get a publication (sales channel) name without using the deprecated Publication.name field?

Am I doing something wrong with the catalog query?

Is the catalog field on publications bugged, and should it actually include results with titles?

 

Any help or information is greatly appreciated, thank you.

Replies 2 (2)

delyanpeev
Shopify Partner
8 1 6

Also experiencing this.

 

To make things even more interesting, I'm getting some auto-generated names for catalog titles when querying a product's publications. Visible below.

 

delyanpeev_0-1718810884411.png

 

finaysse
Shopify Partner
1 0 0

Also having this issue. Has there been an update? I am seeing "Channel Catalog 39xx..." followed by a bunch of alphanumeric when querying for catalog.name