Have your say in Community Polls: What was/is your greatest motivation to start your own business?

Get products published to primary market

Solved

Get products published to primary market

ArtiomO
Shopify Partner
3 1 0

 

Hi community, i am trying to get all products published to primary market.
I assume that can be done using catalogs connection through Admin API.
I am a little stuck on doing this query to achieve that:

query Markets {
    markets(first: 10) {
    edges {
      node {
        name
        catalogs(first: 10) {
            edges{ node {
                publication {
                    name
                }
            }}
            }
        }
      }
    }
  }

 

 

Receiving the following error:

 

 

 

 

 

{
    "errors": [
        {
            "message": "Access denied for publication field.",
            "locations": [
                {
                    "line": 8,
                    "column": 17
                }
            ],
            "path": [
                "markets",
                "edges",
                0,
                "node",
                "catalogs",
                "edges",
                0,
                "node",
                "publication"
            ],
            "extensions": {
                "code": "ACCESS_DENIED",
                "documentation": "https://shopify.dev/api/usage/access-scopes"
            }
        },
]
}

 

 

 

 

 
Here is the access scopes given to the app:

 

 

 

 

scopes = "read_markets,read_orders,read_products,unauthenticated_read_product_listings, write_products"

 

 

 

 

 

"write_products"  was added according to that manual with no success.
What access rights is needed to run that query?
Or it can be retrieved in some other way ?


 

Accepted Solution (1)

ArtiomO
Shopify Partner
3 1 0

This is an accepted solution.

Solved with "read_publications" permission, access scopes doc possibly need an update.

View solution in original post

Replies 2 (2)

ArtiomO
Shopify Partner
3 1 0

Also tried the following  with added scope "read_publications" (not documented in access scopes doc) with same error:

query {
  catalogs(first: 10) {
    edges {
        node {
            title
            id
            publication{
                products(first: 10) {
                    edges {node {
                        title
                    }}
                }
            }
        }
    }
  }
  }

 

 

ArtiomO
Shopify Partner
3 1 0

This is an accepted solution.

Solved with "read_publications" permission, access scopes doc possibly need an update.