publication
Lookup a publication by ID.
Arguments
- •ID!required
The ID of the Publication to return.
Anchor to Possible returnsPossible returns
- Anchor to PublicationPublication•
A publication is a group of products and collections that is published to an app.
- auto
Publish •Boolean!non-null Whether new products are automatically published to this publication.
- catalog•Catalog
The catalog associated with the publication.
- collection
Publications V3 • Resourcenon-nullPublication Connection! The collection publications for the list of collections published to the publication.
- collections
• Collectionnon-nullConnection! The list of collections published to the publication.
- has
Collection •Boolean!non-null Whether the collection is available to the publication.
- id•ID!non-null
A globally-unique ID.
- included
Products • Productnon-nullConnection! The list of products included, but not necessarily published, in the publication.
- operation•Publication
Operation A background operation associated with this publication.
- product
Publications V3 • Resourcenon-nullPublication Connection! The product publications for the list of products published to the publication.
- products
• Productnon-nullConnection! The list of products published to the publication.
- supports
Future •Publishing Boolean!non-null Whether the publication supports future publishing.
- app•App!non-null
The app associated with the publication.
- name•String!non-null
Name of the publication.
- auto
- Retrieve a publication that doesn't exist
- Retrieve an existing publication
Examples
query publication($id: ID!) {
publication(id: $id) {
name
collections(first: 5) {
edges {
node {
id
title
updatedAt
}
}
}
}
}
curl -X POST \
https://your-development-store.myshopify.com/admin/api/unstable/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"
}
}'
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 data = await response.json();
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"
},
},
});
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)