Get products published to a sales channel

I am trying to get products published to my app doing

query Products {
  products(
    first: 100,
	  query: "product_publication_status:999999999999-published"
  ) { 
    nodes {
      id
      title
    }
  }
}

It returns all products, not only those added to sales channel and the warning:

Input `99999999999-published` is not an accepted value

Documentation

I got my app id doing

query App { 
  appByHandle(handle: "app-handle") {
    id
  }
}```
and dropped the   gid://shopify/App/ part of it.


Am I doing anything wrong?

Hi @ReineCarpentier

The value for Channel.app.id is the numeric ID, not the full GID or the string after gid://shopify/App/. You must use the numeric ID of the channel’s associated publication, not the app’s ID itself. These are different: the app’s ID is not always the same as the publication/channel ID.

You can get the publication IDs like this:

query GetPublications {
  publications(first: 10) {
    nodes {
      id
      name
      channel {
        app {
          id
          title
        }
      }
    }
  }
}

Look for the publication that matches your app, and use its numeric ID in the products query.

Thanks !
Turns out i have the same issue as this one: Filtering products by querying publication_status to a sales channel app does not work - #9 by RichK