How to get Queryable objects using GraphQL Admin API?

Hi there,

I have found the documentation about NavigationItem in Queryable objects section but actually I can’t find how I can access to the object in a query.

I checked all object in query: QueryRoot in my GraphiQL app but no luck.
Does anyone know where I can find how to do it in somewhere?

Hi @masato_arai

With the documentation, you will need to also understand the structure. If we look at NavigationItem you will see that it is returned by Shop.NavigationSettings. This means you will need to build your query in the same way. Here is a link to the NavigationSettings within the Shop object: https://help.shopify.com/en/api/graphql-admin-api/reference/object/shop?api[version]=2019-10#navigationsettings-2019-10

An example would be:

{
  shop {
    navigationSettings {
      id
      title
      url
    }
  }
}

Hi @vix ,

Somehow I can’t see navigationSettings in my Shop object.

Am I looking at different place?

Hi @masato_arai

Make sure that you are looking at the GraphQL Admin API vs. the GraphQL Storefront API. You will also want to make sure you are using the correct version, although for this attribute it will be in all versions.

Hmm, I think I am looking at Graphql Admin API as my endpoint and header settings are below.

https://{shop}.myshopify.com/admin/api/2019-10/graphql.json

Content-Type: application/json

X-Shopify-Access-Token: <ACCESS_TOKEN>

But I got an error says:
“Internal error. Looks like something went wrong on our end.\nRequest ID: dc665f52-1f95-4451-8a16-1d6a40ed2d39 (include this in support requests).”

Interesting. Are you using the Shopify GraphiQL app? I am able to replicate the error on a private app intermittently so I will dig into this more and let you know. Using the GraphiQL app from the admin however, I am able to do the query without issue. Keep in mind, this also may not be the navigation you are thinking i.e the theme navigation.

I am using GraphiQL app on Mac.

Ah yes, I can get the object using the GraphiQL app from the admin, too.

But I get an error says "message":"Field 'navigationSettings' doesn't exist on type using the query on my app.

So which query object should I use to get the data for the Navigation I attached below?