How to get Queryable objects using GraphQL Admin API?

New Member
4 0 0

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?

 

Screenshot 2019-11-04 at 08.36.25.jpg

0 Likes
Shopify Staff
Shopify Staff
188 20 19

 

 

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#navigat...

 

An example would be: 

 

{
  shop {
    navigationSettings {
      id
      title
      url
    }
  }
}

Vix | Developer Support @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 


0 Likes
New Member
4 0 0

Hi @vix ,

 

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

Am I looking at different place?

 

Screenshot 2019-11-05 at 10.39.15.jpg

0 Likes
Shopify Staff
Shopify Staff
188 20 19

 

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.  

Vix | Developer Support @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 


0 Likes
New Member
4 0 0

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)."

 

Screenshot 2019-11-06 at 08.00.25.png

0 Likes
Shopify Staff
Shopify Staff
188 20 19

 

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. 

 

Vix | Developer Support @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 


0 Likes
New Member
4 0 0

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?

 

 Screenshot 2019-11-08 at 08.56.12.jpg

0 Likes