Retrieving the handle for OnlineStorePage via GraphQL Admin API

StephenK
Shopify Partner
36 2 15

When getting a page from the Online Store by ID either using the node or translatableResource queries.

The handle never appears to be a resource that's available.

Example GraphQL I've tried so far, can anyone point me in the right direction?

query getPage($id: ID!) {
    translatableResource(resourceId: $id) {
      translatableContent {
        digest
        key
        value
        locale
      }
    }
    node(id: $id) {
      ... on OnlineStorePage {
        id
        defaultCursor
        translations(locale: "en") {
          key
          value
          locale
        }
      }
    }
  }

 

Some Shopify/Ecommerce related articles - https://medium.com/@stephenkeable
0 Likes
StephenK
Shopify Partner
36 2 15

It's possible over on the REST Admin API, so surprised I can't find something similar via GraphQL:-

https://shopify.dev/docs/admin-api/rest/reference/online-store/page#show-2021-01 

Some Shopify/Ecommerce related articles - https://medium.com/@stephenkeable
0 Likes
_JCC_
Shopify Staff
Shopify Staff
145 20 26

Hey @StephenK,

I don't believe there to be an issue in GraphQL query, I believe this to be a gap on our end. I've created an issue highlighting the discrepancy between the REST and GraphQL endpoints for the resources OnlineStorePage, OnlineStoreBlog, and OnlineStoreArticle. I don't have a timeline for a fix but can follow-up when I know more.

Regards,

John 

John C | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

StephenK
Shopify Partner
36 2 15

That’s frustrating, however helpful to know I wasn’t going crazy etc

thanks for raising the ticket internally, we are using the REST API for our solution for now. Hopefully we’ll be able to swap back somewhere down the road.

thanks

Some Shopify/Ecommerce related articles - https://medium.com/@stephenkeable
0 Likes