Anchor to page
page
query
Returns a Page resource by ID.
Anchor to Possible returnsPossible returns
- Anchor to PagePage•
A page on the Online Store.
Was this section helpful?
Retrieves a single page by its ID
const { admin } = await authenticate.admin(request);
const response = await admin.graphql(
`#graphql
query PageShow($id: ID!) {
page(id: $id) {
id
title
handle
}
}`,
{
variables: {
"id": "gid://shopify/Page/602767277"
},
},
);
const data = await response.json();
query PageShow($id: ID!) {
page(id: $id) {
id
title
handle
}
}
curl -X POST \
https://your-development-store.myshopify.com/admin/api/2025-01/graphql.json \
-H 'Content-Type: application/json' \
-H 'X-Shopify-Access-Token: {access_token}' \
-d '{
"query": "query PageShow($id: ID!) { page(id: $id) { id title handle } }",
"variables": {
"id": "gid://shopify/Page/602767277"
}
}'
const { admin } = await authenticate.admin(request);
const response = await admin.graphql(
`#graphql
query PageShow($id: ID!) {
page(id: $id) {
id
title
handle
}
}`,
{
variables: {
"id": "gid://shopify/Page/602767277"
},
},
);
const data = await response.json();
const client = new shopify.clients.Graphql({session});
const data = await client.query({
data: {
"query": `query PageShow($id: ID!) {
page(id: $id) {
id
title
handle
}
}`,
"variables": {
"id": "gid://shopify/Page/602767277"
},
},
});
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 PageShow($id: ID!) {
page(id: $id) {
id
title
handle
}
}
QUERY
variables = {
"id": "gid://shopify/Page/602767277"
}
response = client.query(query: query, variables: variables)
Input variables
JSON{
"id": "gid://shopify/Page/602767277"
}
Response
JSON{
"page": {
"id": "gid://shopify/Page/602767277",
"title": "Sample Page",
"handle": "samplepage"
}
}