[GraphQL API] How to validate if variant is available in online store sales channel?

I gave this a go in my test store and it actually turns out catalog.title isn’t “Online Store”. On my test shop it comes back as “Channel Catalog 141579583637 for Online Store”, an auto-generated string, so it’d be better to match on the channel handle instead, which is stable and not localized:

query {
  publications(first: 50, catalogType: APP) {
    edges {
      node {
        id
        channels(first: 1) { nodes { handle name } }
      }
    }
  }
}

You can get the node where channels.nodes.handle equals “online_store” and use that id. If you’d rather match on a display string, channels.name gives you “Online Store”, and unlike publication.name that one isn’t deprecated.

So steps 1 and 3 are spot on, I’d tweak step 3!