Pages field on QueryRoot for Storefront API

Has the pages field been deprecated on QueryRoot? Or was it just never implemented? It’s not working for me. Appreciate any answers :slight_smile:

Hi Ryan,

Works just fine.

I noticed you write field in your question. The pages property is a connection so it isn’t queried like a field.

Have you tried it like so?

query {
  pages(first:10) {
    edges {
      node {
        handle
      }
    }
  }
}

Let me know if above works for you.

Hey Karl! Thanks for the reply. Here’s what’s going on in my GraphiQL tool.

{
  "errors": [
    {
      "message": "Field 'pages' doesn't exist on type 'QueryRoot'",
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ],
      "fields": [
        "query",
        "pages"
      ]
    }
  ]
}

Hmm… Ryan, what GraphQL endpoint are you hitting? Shopify has 2, the Storefront and the Admin. You may be trying to query the wrong one.

1 Like

Karl, you’re right, the GraphiQL tool in my App section is hooked up to the Admin API oops, lol.