--- title: publication - GraphQL Admin description: |- Retrieves a [`Publication`](https://shopify.dev/docs/api/admin-graphql/latest/objects/Publication) by [`ID`](https://shopify.dev/docs/api/usage/gids). Returns `null` if the publication doesn't exist. api_version: 2025-10 api_name: admin type: query api_type: graphql source_url: html: https://shopify.dev/docs/api/admin-graphql/latest/queries/Publication md: https://shopify.dev/docs/api/admin-graphql/latest/queries/Publication.md --- # publication query Retrieves a [`Publication`](https://shopify.dev/docs/api/admin-graphql/latest/objects/Publication) by [`ID`](https://shopify.dev/docs/api/usage/gids). Returns `null` if the publication doesn't exist. ## Arguments * id [ID!](https://shopify.dev/docs/api/admin-graphql/latest/scalars/ID) required The ID of the Publication to return. *** ## Possible returns * Publication [Publication](https://shopify.dev/docs/api/admin-graphql/latest/objects/Publication) A group of [products](https://shopify.dev/docs/api/admin-graphql/latest/objects/Product) and [collections](https://shopify.dev/docs/api/admin-graphql/latest/objects/Collection) that are published to an app. Each publication manages which products and collections display on its associated [`Channel`](https://shopify.dev/docs/api/admin-graphql/latest/objects/Channel). Merchants can automatically publish products when they're created if [`autoPublish`](https://shopify.dev/docs/api/admin-graphql/latest/objects/Publication#field-Publication.fields.autoPublish) is enabled, or manually control publication through publication records. Publications support scheduled publishing through future publish dates for online store channels, allowing merchants to coordinate product launches and promotional campaigns. The [`catalog`](https://shopify.dev/docs/api/admin-graphql/latest/objects/Publication#field-Publication.fields.catalog) field links to pricing and availability rules specific to that publication's context. * auto​Publish [Boolean!](https://shopify.dev/docs/api/admin-graphql/latest/scalars/Boolean) non-null Whether new products are automatically published to this publication. * catalog [Catalog](https://shopify.dev/docs/api/admin-graphql/latest/interfaces/Catalog) The catalog associated with the publication. * collection​Publications​V3 [Resource​Publication​Connection!](https://shopify.dev/docs/api/admin-graphql/latest/connections/ResourcePublicationConnection) non-null The list of collection publication records, each representing the publication status and details for a collection published to this publication (typically channel). * first [Int](https://shopify.dev/docs/api/admin-graphql/latest/scalars/Int) ### Arguments The first `n` elements from the [paginated list](https://shopify.dev/api/usage/pagination-graphql). * after [String](https://shopify.dev/docs/api/admin-graphql/latest/scalars/String) The elements that come after the specified [cursor](https://shopify.dev/api/usage/pagination-graphql). * last [Int](https://shopify.dev/docs/api/admin-graphql/latest/scalars/Int) The last `n` elements from the [paginated list](https://shopify.dev/api/usage/pagination-graphql). * before [String](https://shopify.dev/docs/api/admin-graphql/latest/scalars/String) The elements that come before the specified [cursor](https://shopify.dev/api/usage/pagination-graphql). * reverse [Boolean](https://shopify.dev/docs/api/admin-graphql/latest/scalars/Boolean) Default:false Reverse the order of the underlying list. *** * collections [Collection​Connection!](https://shopify.dev/docs/api/admin-graphql/latest/connections/CollectionConnection) non-null The list of collections published to the publication. * first [Int](https://shopify.dev/docs/api/admin-graphql/latest/scalars/Int) ### Arguments The first `n` elements from the [paginated list](https://shopify.dev/api/usage/pagination-graphql). * after [String](https://shopify.dev/docs/api/admin-graphql/latest/scalars/String) The elements that come after the specified [cursor](https://shopify.dev/api/usage/pagination-graphql). * last [Int](https://shopify.dev/docs/api/admin-graphql/latest/scalars/Int) The last `n` elements from the [paginated list](https://shopify.dev/api/usage/pagination-graphql). * before [String](https://shopify.dev/docs/api/admin-graphql/latest/scalars/String) The elements that come before the specified [cursor](https://shopify.dev/api/usage/pagination-graphql). * reverse [Boolean](https://shopify.dev/docs/api/admin-graphql/latest/scalars/Boolean) Default:false Reverse the order of the underlying list. *** * has​Collection [Boolean!](https://shopify.dev/docs/api/admin-graphql/latest/scalars/Boolean) non-null Whether the collection is available to the publication. * id [ID!](https://shopify.dev/docs/api/admin-graphql/latest/scalars/ID) required ### Arguments Collection ID to check. *** * id [ID!](https://shopify.dev/docs/api/admin-graphql/latest/scalars/ID) non-null A globally-unique ID. * included​Products [Product​Connection!](https://shopify.dev/docs/api/admin-graphql/latest/connections/ProductConnection) non-null The list of products included, but not necessarily published, in the publication. * first [Int](https://shopify.dev/docs/api/admin-graphql/latest/scalars/Int) ### Arguments The first `n` elements from the [paginated list](https://shopify.dev/api/usage/pagination-graphql). * after [String](https://shopify.dev/docs/api/admin-graphql/latest/scalars/String) The elements that come after the specified [cursor](https://shopify.dev/api/usage/pagination-graphql). * last [Int](https://shopify.dev/docs/api/admin-graphql/latest/scalars/Int) The last `n` elements from the [paginated list](https://shopify.dev/api/usage/pagination-graphql). * before [String](https://shopify.dev/docs/api/admin-graphql/latest/scalars/String) The elements that come before the specified [cursor](https://shopify.dev/api/usage/pagination-graphql). * reverse [Boolean](https://shopify.dev/docs/api/admin-graphql/latest/scalars/Boolean) Default:false Reverse the order of the underlying list. * sort​Key [Product​Sort​Keys](https://shopify.dev/docs/api/admin-graphql/latest/enums/ProductSortKeys) Default:ID Sort the underlying list using a key. If your query is slow or returns an error, then [try specifying a sort key that matches the field used in the search](https://shopify.dev/api/usage/pagination-graphql#search-performance-considerations). * query [String](https://shopify.dev/docs/api/admin-graphql/latest/scalars/String) A filter made up of terms, connectives, modifiers, and comparators. You can apply one or more filters to a query. Learn more about [Shopify API search syntax](https://shopify.dev/api/usage/search-syntax). * * default string * barcode string * bundles boolean * category\_id string * collection\_id id * combined\_listing\_role string * created\_at time * delivery\_profile\_id id * error\_feedback string - Filter by a case-insensitive search of multiple fields in a document. - Example: * `query=Bob Norman` * `query=title:green hoodie` Filter by the product variant [`barcode`](https://shopify.dev/api/admin-graphql/latest/objects/ProductVariant#field-barcode) field. - Example: * `barcode:ABC-abc-1234` Filter by a [product bundle](https://shopify.dev/docs/apps/build/product-merchandising/bundles). A product bundle is a set of two or more related products, which are commonly offered at a discount. - Example: * `bundles:true` Filter by the product [category ID](https://shopify.dev/api/admin-graphql/latest/objects/Product#field-category) (`product.category.id`). A product category is the category of a product from [Shopify's Standard Product Taxonomy](https://shopify.github.io/product-taxonomy/releases/unstable/?categoryId=sg-4-17-2-17). - Example: * `category_id:sg-4-17-2-17` Filter by the collection [`id`](https://shopify.dev/api/admin-graphql/latest/objects/Collection#field-id) field. - Example: * `collection_id:108179161409` Filter by the role of the product in a [combined listing](https://shopify.dev/apps/build/product-merchandising/combined-listings). - Valid values: * `parent` * `child` * `no_role` Example: * `combined_listing_role:parent` Filter by the date and time when the product was created. - Example: * `created_at:>'2020-10-21T23:39:20Z'` * `created_at:=1234` * `id:<=1234` Filter by inventory count. - Example: * `inventory_total:0` * `inventory_total:>150` * `inventory_total:>=200` Filter by products that have a reduced price. For more information, refer to the [`CollectionRule`](https://shopify.dev/api/admin-graphql/latest/objects/CollectionRule) object. - Example: * `is_price_reduced:true` Filters resources by metafield value. Format: `metafields.{namespace}.{key}:{value}`. Learn more about [querying by metafield value](https://shopify.dev/apps/build/custom-data/metafields/query-by-metafield-value). - Example: * `metafields.custom.on_sale:true` * `metafields.product.material:"gid://shopify/Metaobject/43458085"` Filter by products that are out of stock in at least one location. - Example: * `out_of_stock_somewhere:true` Filter by the product variant [`price`](https://shopify.dev/api/admin-graphql/latest/objects/Productvariant#field-price) field. - Example: * `price:100.57` Filter by the app [`id`](https://shopify.dev/api/admin-graphql/latest/objects/App#field-id) field. - Example: * `product_configuration_owner:10001` Filter by channel approval process status of the resource on a channel, such as the online store. The value is a composite of the [channel `app` ID](https://shopify.dev/api/admin-graphql/latest/objects/Channel#field-Channel.fields.app) (`Channel.app.id`) and one of the valid values. For simple visibility checks, use [published\_status](https://shopify.dev/api/admin-graphql/latest/queries/products#argument-query-filter-publishable_status) instead. - Valid values: * `* {channel_app_id}-approved` * `* {channel_app_id}-rejected` * `* {channel_app_id}-needs_action` * `* {channel_app_id}-awaiting_review` * `* {channel_app_id}-published` * `* {channel_app_id}-demoted` * `* {channel_app_id}-scheduled` * `* {channel_app_id}-provisionally_published` Example: * `product_publication_status:189769876-approved` Filter by a comma-separated list of [product types](https://help.shopify.com/manual/products/details/product-type). - Example: * `product_type:snowboard` Filter by a comma-separated list of publication IDs that are associated with the product. - Example: * `publication_ids:184111530305,184111694145` **Deprecated:** This parameter is deprecated as of 2025-12 and will be removed in a future API version. Use [published\_status](https://shopify.dev/api/admin-graphql/latest/queries/products#argument-query-filter-publishable_status) for visibility checks. Filter by the publishable status of the resource on a channel. The value is a composite of the [channel `app` ID](https://shopify.dev/api/admin-graphql/latest/objects/Channel#app-price) (`Channel.app.id`) and one of the valid status values. - Valid values: * `* {channel_app_id}-unset` * `* {channel_app_id}-pending` * `* {channel_app_id}-approved` * `* {channel_app_id}-not_approved` Example: * `publishable_status:580111-unset` * `publishable_status:580111-pending` Filter by the date and time when the product was published to the online store and other sales channels. - Example: * `published_at:>2020-10-21T23:39:20Z` * `published_at:'2020-10-21T23:39:20Z'` * `updated_at:'2020-10-21T23:39:20Z'` * `created_at:=1234` * `id:<=1234` Filter by inventory count. - Example: * `inventory_total:0` * `inventory_total:>150` * `inventory_total:>=200` Filter by products that have a reduced price. For more information, refer to the [`CollectionRule`](https://shopify.dev/api/admin-graphql/latest/objects/CollectionRule) object. - Example: * `is_price_reduced:true` Filters resources by metafield value. Format: `metafields.{namespace}.{key}:{value}`. Learn more about [querying by metafield value](https://shopify.dev/apps/build/custom-data/metafields/query-by-metafield-value). - Example: * `metafields.custom.on_sale:true` * `metafields.product.material:"gid://shopify/Metaobject/43458085"` Filter by products that are out of stock in at least one location. - Example: * `out_of_stock_somewhere:true` Filter by the product variant [`price`](https://shopify.dev/api/admin-graphql/latest/objects/Productvariant#field-price) field. - Example: * `price:100.57` Filter by the app [`id`](https://shopify.dev/api/admin-graphql/latest/objects/App#field-id) field. - Example: * `product_configuration_owner:10001` Filter by channel approval process status of the resource on a channel, such as the online store. The value is a composite of the [channel `app` ID](https://shopify.dev/api/admin-graphql/latest/objects/Channel#field-Channel.fields.app) (`Channel.app.id`) and one of the valid values. For simple visibility checks, use [published\_status](https://shopify.dev/api/admin-graphql/latest/queries/products#argument-query-filter-publishable_status) instead. - Valid values: * `* {channel_app_id}-approved` * `* {channel_app_id}-rejected` * `* {channel_app_id}-needs_action` * `* {channel_app_id}-awaiting_review` * `* {channel_app_id}-published` * `* {channel_app_id}-demoted` * `* {channel_app_id}-scheduled` * `* {channel_app_id}-provisionally_published` Example: * `product_publication_status:189769876-approved` Filter by a comma-separated list of [product types](https://help.shopify.com/manual/products/details/product-type). - Example: * `product_type:snowboard` Filter by a comma-separated list of publication IDs that are associated with the product. - Example: * `publication_ids:184111530305,184111694145` **Deprecated:** This parameter is deprecated as of 2025-12 and will be removed in a future API version. Use [published\_status](https://shopify.dev/api/admin-graphql/latest/queries/products#argument-query-filter-publishable_status) for visibility checks. Filter by the publishable status of the resource on a channel. The value is a composite of the [channel `app` ID](https://shopify.dev/api/admin-graphql/latest/objects/Channel#app-price) (`Channel.app.id`) and one of the valid status values. - Valid values: * `* {channel_app_id}-unset` * `* {channel_app_id}-pending` * `* {channel_app_id}-approved` * `* {channel_app_id}-not_approved` Example: * `publishable_status:580111-unset` * `publishable_status:580111-pending` Filter by the date and time when the product was published to the online store and other sales channels. - Example: * `published_at:>2020-10-21T23:39:20Z` * `published_at:'2020-10-21T23:39:20Z'` * `updated_at:'2020-10-21T23:39:20Z'` * `created_at:=1234` * `id:<=1234` Filter by inventory count. - Example: * `inventory_total:0` * `inventory_total:>150` * `inventory_total:>=200` Filter by products that have a reduced price. For more information, refer to the [`CollectionRule`](https://shopify.dev/api/admin-graphql/latest/objects/CollectionRule) object. - Example: * `is_price_reduced:true` Filters resources by metafield value. Format: `metafields.{namespace}.{key}:{value}`. Learn more about [querying by metafield value](https://shopify.dev/apps/build/custom-data/metafields/query-by-metafield-value). - Example: * `metafields.custom.on_sale:true` * `metafields.product.material:"gid://shopify/Metaobject/43458085"` Filter by products that are out of stock in at least one location. - Example: * `out_of_stock_somewhere:true` Filter by the product variant [`price`](https://shopify.dev/api/admin-graphql/latest/objects/Productvariant#field-price) field. - Example: * `price:100.57` Filter by the app [`id`](https://shopify.dev/api/admin-graphql/latest/objects/App#field-id) field. - Example: * `product_configuration_owner:10001` Filter by channel approval process status of the resource on a channel, such as the online store. The value is a composite of the [channel `app` ID](https://shopify.dev/api/admin-graphql/latest/objects/Channel#field-Channel.fields.app) (`Channel.app.id`) and one of the valid values. For simple visibility checks, use [published\_status](https://shopify.dev/api/admin-graphql/latest/queries/products#argument-query-filter-publishable_status) instead. - Valid values: * `* {channel_app_id}-approved` * `* {channel_app_id}-rejected` * `* {channel_app_id}-needs_action` * `* {channel_app_id}-awaiting_review` * `* {channel_app_id}-published` * `* {channel_app_id}-demoted` * `* {channel_app_id}-scheduled` * `* {channel_app_id}-provisionally_published` Example: * `product_publication_status:189769876-approved` Filter by a comma-separated list of [product types](https://help.shopify.com/manual/products/details/product-type). - Example: * `product_type:snowboard` Filter by a comma-separated list of publication IDs that are associated with the product. - Example: * `publication_ids:184111530305,184111694145` **Deprecated:** This parameter is deprecated as of 2025-12 and will be removed in a future API version. Use [published\_status](https://shopify.dev/api/admin-graphql/latest/queries/products#argument-query-filter-publishable_status) for visibility checks. Filter by the publishable status of the resource on a channel. The value is a composite of the [channel `app` ID](https://shopify.dev/api/admin-graphql/latest/objects/Channel#app-price) (`Channel.app.id`) and one of the valid status values. - Valid values: * `* {channel_app_id}-unset` * `* {channel_app_id}-pending` * `* {channel_app_id}-approved` * `* {channel_app_id}-not_approved` Example: * `publishable_status:580111-unset` * `publishable_status:580111-pending` Filter by the date and time when the product was published to the online store and other sales channels. - Example: * `published_at:>2020-10-21T23:39:20Z` * `published_at:'2020-10-21T23:39:20Z'` * `updated_at: { const { admin } = await authenticate.admin(request); const response = await admin.graphql( `#graphql query publication($id: ID!) { publication(id: $id) { name collections(first: 5) { edges { node { id title updatedAt } } } } }`, { variables: { "id": "gid://shopify/Publication/-1" }, }, ); const json = await response.json(); return json.data; } ``` #### Ruby ```ruby session = ShopifyAPI::Auth::Session.new( shop: "your-development-store.myshopify.com", access_token: access_token ) client = ShopifyAPI::Clients::Graphql::Admin.new( session: session ) query = <<~QUERY query publication($id: ID!) { publication(id: $id) { name collections(first: 5) { edges { node { id title updatedAt } } } } } QUERY variables = { "id": "gid://shopify/Publication/-1" } response = client.query(query: query, variables: variables) ``` #### Node.js ```javascript const client = new shopify.clients.Graphql({session}); const data = await client.query({ data: { "query": `query publication($id: ID!) { publication(id: $id) { name collections(first: 5) { edges { node { id title updatedAt } } } } }`, "variables": { "id": "gid://shopify/Publication/-1" }, }, }); ``` #### Response ```json { "publication": null } ``` * ### Retrieve an existing publication #### Query ```graphql query publication($id: ID!) { publication(id: $id) { name collections(first: 5) { edges { node { id title updatedAt } } } } } ``` #### Variables ```json { "id": "gid://shopify/Publication/244171671" } ``` #### cURL ```bash curl -X POST \ https://your-development-store.myshopify.com/admin/api/2025-10/graphql.json \ -H 'Content-Type: application/json' \ -H 'X-Shopify-Access-Token: {access_token}' \ -d '{ "query": "query publication($id: ID!) { publication(id: $id) { name collections(first: 5) { edges { node { id title updatedAt } } } } }", "variables": { "id": "gid://shopify/Publication/244171671" } }' ``` #### React Router ```javascript import { authenticate } from "../shopify.server"; export const loader = async ({request}) => { const { admin } = await authenticate.admin(request); const response = await admin.graphql( `#graphql query publication($id: ID!) { publication(id: $id) { name collections(first: 5) { edges { node { id title updatedAt } } } } }`, { variables: { "id": "gid://shopify/Publication/244171671" }, }, ); const json = await response.json(); return json.data; } ``` #### Ruby ```ruby session = ShopifyAPI::Auth::Session.new( shop: "your-development-store.myshopify.com", access_token: access_token ) client = ShopifyAPI::Clients::Graphql::Admin.new( session: session ) query = <<~QUERY query publication($id: ID!) { publication(id: $id) { name collections(first: 5) { edges { node { id title updatedAt } } } } } QUERY variables = { "id": "gid://shopify/Publication/244171671" } response = client.query(query: query, variables: variables) ``` #### Node.js ```javascript const client = new shopify.clients.Graphql({session}); const data = await client.query({ data: { "query": `query publication($id: ID!) { publication(id: $id) { name collections(first: 5) { edges { node { id title updatedAt } } } } }`, "variables": { "id": "gid://shopify/Publication/244171671" }, }, }); ``` #### Response ```json { "publication": { "name": "Online Store", "collections": { "edges": [ { "node": { "id": "gid://shopify/Collection/79210309", "title": "Custom Other Items", "updatedAt": "2008-10-10T00:00:00Z" } }, { "node": { "id": "gid://shopify/Collection/94229130", "title": "All products more expensive than free", "updatedAt": "2006-02-02T00:00:00Z" } }, { "node": { "id": "gid://shopify/Collection/142458073", "title": "All snowboards", "updatedAt": "2006-02-02T00:00:00Z" } }, { "node": { "id": "gid://shopify/Collection/411960790", "title": "Bold snowboards", "updatedAt": "2006-02-02T00:00:00Z" } }, { "node": { "id": "gid://shopify/Collection/431528632", "title": "All arbor products tagged deepsnow", "updatedAt": "2006-02-02T00:00:00Z" } } ] } } } ``` [Open in GraphiQL](http://localhost:3457/graphiql?query=query%20publication\(%24id%3A%20ID!\)%20%7B%0A%20%20publication\(id%3A%20%24id\)%20%7B%0A%20%20%20%20name%0A%20%20%20%20collections\(first%3A%205\)%20%7B%0A%20%20%20%20%20%20edges%20%7B%0A%20%20%20%20%20%20%20%20node%20%7B%0A%20%20%20%20%20%20%20%20%20%20id%0A%20%20%20%20%20%20%20%20%20%20title%0A%20%20%20%20%20%20%20%20%20%20updatedAt%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%20%20%7D%0A%7D\&variables=%7B%0A%20%20%22id%22%3A%20%22gid%3A%2F%2Fshopify%2FPublication%2F-1%22%0A%7D) ##### GQL ```graphql query publication($id: ID!) { publication(id: $id) { name collections(first: 5) { edges { node { id title updatedAt } } } } } ``` ##### cURL ```bash curl -X POST \ https://your-development-store.myshopify.com/admin/api/2025-10/graphql.json \ -H 'Content-Type: application/json' \ -H 'X-Shopify-Access-Token: {access_token}' \ -d '{ "query": "query publication($id: ID!) { publication(id: $id) { name collections(first: 5) { edges { node { id title updatedAt } } } } }", "variables": { "id": "gid://shopify/Publication/-1" } }' ``` ##### React Router ```javascript import { authenticate } from "../shopify.server"; export const loader = async ({request}) => { const { admin } = await authenticate.admin(request); const response = await admin.graphql( `#graphql query publication($id: ID!) { publication(id: $id) { name collections(first: 5) { edges { node { id title updatedAt } } } } }`, { variables: { "id": "gid://shopify/Publication/-1" }, }, ); const json = await response.json(); return json.data; } ``` ##### Node.js ```javascript const client = new shopify.clients.Graphql({session}); const data = await client.query({ data: { "query": `query publication($id: ID!) { publication(id: $id) { name collections(first: 5) { edges { node { id title updatedAt } } } } }`, "variables": { "id": "gid://shopify/Publication/-1" }, }, }); ``` ##### Ruby ```ruby session = ShopifyAPI::Auth::Session.new( shop: "your-development-store.myshopify.com", access_token: access_token ) client = ShopifyAPI::Clients::Graphql::Admin.new( session: session ) query = <<~QUERY query publication($id: ID!) { publication(id: $id) { name collections(first: 5) { edges { node { id title updatedAt } } } } } QUERY variables = { "id": "gid://shopify/Publication/-1" } response = client.query(query: query, variables: variables) ``` ## Input variables JSON ```json { "id": "gid://shopify/Publication/-1" } ``` ## Response JSON ```json { "publication": null } ```