Development discussions around payment processing APIs
Hi!
In the latest version 2023-04, the publication field name is deprecated. I am looking for the publication name field to find the publication ID of the online store, but this "catalog type" has no catalog attached and returns null.
Query:
query getFirstTenPublicacationApps { publications(first: 10, catalogType: APP) { edges { node { id name catalog { title } } } } }
Result:
{ "data": { "publications": { "edges": [ { "node": { "id": "gid://shopify/Publication/84636696754", "name": "Online Store", "catalog": null } }, { "node": { "id": "gid://shopify/Publication/90088702130", "name": "Shopify GraphiQL App", "catalog": null } } ] } }, "extensions": { "cost": { "requestedQueryCost": 22, "actualQueryCost": 6, "throttleStatus": { "maximumAvailable": 1000, "currentlyAvailable": 994, "restoreRate": 50 } } } }
...any alternative to get the online store publication id without consuming deprecated fields ?
Thanks!
Solved! Go to the solution
This is an accepted solution.
Hi @chris-sellboost 👋
Currently apps don't have catalogs associated with them, and we are actively working on this at the moment. We'll post an update as soon as it's completed.
Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
This is an accepted solution.
Hi @chris-sellboost 👋
Currently apps don't have catalogs associated with them, and we are actively working on this at the moment. We'll post an update as soon as it's completed.
Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
This answer makes no sense. And you call it the accepted solution? First off, this is not an App associated with a catalog, it is a product. Second of all, how can you deprecate something and offer null as the option? I get it, you need a few days to fix this issue. Great! What does it mean you'll post an update when it is completed? To this topic?
I accept it as a solution because the previous version is still supported, I can keep my application stable in that API version, in any case, it doesn't cause any strange behavior, I simply can't implement the new catalog structure, as I mentioned, in my case right now is not a blockage.
Appreciate your participation here! My take on this is that this whole issue on Shopify to properly resolve. One, if you are going to play with deprecations, do it properly. Announce it only when the code you're deprecating has new working code to replace it. Second, the documentation uses verbs like "Use this instead". So when you "use that instead" and get errors or garbage, it is a bad experience.
So more or less, I am simply informing the community that this issue is bad, whereas the solution as you point out, is to ignore it all and just keep on using old code. Touché, but less than ideal!
@chris-sellboost @Hunk Just created a new support ticket for this as it has been 7 months with no update.
From my investigations, products are connected to publications, but not catalogs (null). Markets are connected to catalogs, but not publications. As a result, it is rather challenging to determine where a product is available for purchase (online store? channel app (Google, FB, etc...), market geo? (Canada, US, etc...). Fortunately the deprecated field publication.name still returns data, so it at least provides some clues to manually tie these datasets together (products, publications, catalogs, markets)
Thanks for confirmation @SteveKaran . It is true. We can still use the deprecated publication name field. I do find it awkward though to keep on publishing modern Apps with deprecated code. It irks. I wish this was not an issue, drawn for so long!!
So for the time being are you querying via:
query {
channels(first: 10) {
edges {
node {
id
name
}
}
}
OR:
query {
publications(first: 10) {
edges {
node {
id
name
}
}
}
}
And then filtering by name?
EDIT: I'm going with the publications query and the single deprecated name field over the deprecated channels query and name field
Unless I'm missing something - it seems like a real gap in the GraphQL API that there is no categorical way to query the Online Store publicationId.
Simultaneously, it seems like this publicationId would be required to do any non-deprecated creation of collections or products?
Channels are useless. There is nothing actionable in there. If I recall, it returns encoded gobble-dee-**bleep** that maps to nothing I can use. Or it is nil. So I just fall back to deprecated publication name field. Which is the whole ugly nature of this.