Hey there,
it seems that the nodes query does not support node ids of type CustomerAccountPage
.
The following query
{
nodes(ids: ["gid://shopify/CustomerAccountPage/123456789"]) {
id
}
}
does return
{
"errors": [
{
"message": "invalid id",
"locations": [
{
"line": 2,
"column": 3
}
],
"path": [
"nodes"
]
}
],
"data": null
}
I testet it on 2024-10
, 2025-01
and unstable
. I verified this with the GraphiQL explorer here to make sure it is not an error on how I use the API: GraphiQL for the Admin API
I also made sure to first fetch available pages with the customerAccountPages
. But event if the object could not be found normally this query then returns data.
Hi, I’ve confirmed with the team that this isn’t presently supported. I’ll reach out to the team to let them know about the issue and let them triage it from there.
In order to provide them with as much information as possible, could you share the use case for querying CustomerAccountPage
objects?
Hey @JR-Shopify sorry for my late response and thank you for confirming this with the team. We are querying menus using the GraphQL admin api. Then we have a query similar to this were we resolve the handles of menu entries
query FetchItemHandles($ids: [ID!]!) {
nodes(ids: $ids) {
...on Collection {
id
handle
title
}
...on Product {
id
handle
title
}
...on Page {
id
handle
title
}
...on Blog {
id
handle
title
}
<... more entries>
}
We pass the resource ids we receive from the menus query to the $ids
variable. But this returns an error if any id of type CustomerAccountPage is provided. It does not behave like an unknown id where null
is returned but we receive no results at all. Of course it would be also great to receive the data, but at least it should not break queries where you pass valid handles.
Hi, thanks for the info. I’ve passed it along to the team for awareness. I can’t speak to any timelines for resolution, but the context will definitely be useful.
For the time being your best bet might be to filter out the CustomerAccountPage
ids before passing them along to your fetch query.