FROM CACHE - en_header

Themes list using GraphQL

Solved
clucs123
Excursionist
18 0 3

Hello

 

I'm writing an embedded app and I need it to display a list of themes for the user. Once the user has selected a theme I then want to add some assets to that theme. I want to move away from REST to using GraphQL.

 

The endpoint for REST is...

/admin/api/2019-10/themes.json

Is this query possible using GraphQL? I can't find a queryRoot that relates to themes or assets.

 

Many thanks

 

Paul

Accepted Solution (1)

Accepted Solutions
Ryan
Shopify Staff
Shopify Staff
499 42 119

This is an accepted solution.

Hi @clucs123,

 

I took a quick look as well and I don't believe themes or assets are accessible via API currently.  Is there something you are trying to accomplish that can't be done through REST so you were looking at GraphQL? Or just converting in general.

Ryan | 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 the Shopify Help Center or the Shopify Blog

View solution in original post

Replies 4 (4)
Ryan
Shopify Staff
Shopify Staff
499 42 119

This is an accepted solution.

Hi @clucs123,

 

I took a quick look as well and I don't believe themes or assets are accessible via API currently.  Is there something you are trying to accomplish that can't be done through REST so you were looking at GraphQL? Or just converting in general.

Ryan | 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 the Shopify Help Center or the Shopify Blog

clucs123
Excursionist
18 0 3

Hi Ryan

 

I'm just trying to use graphql whenever possible and couldn't find themes or assets anywhere in the schema.

 

I using the REST API now for the themes GET so it's not a problem.

 

Thanks for taking a look.

 

Paul

neel738
New Member
6 0 0

Hi! is there a way to access assets/themes using GraphQL?

 

 

ryantkelly
Excursionist
12 0 12

Hi -

Looks like this thread is quiet, but is just what I'm looking for.

The /themes.json endpoint from REST API returns a graphQL id:

        {
            "id": 123456789,
            "name": "Theme 4 Old",
            "created_at": "2019-08-02T11:41:13-04:00",
            "updated_at": "2020-03-23T14:54:10-04:00",
            "role": "unpublished",
            "theme_store_id": null,
            "previewable": true,
            "processing": false,
            "admin_graphql_api_id": "gid://shopify/Theme/123456789"
        }

 

I find it odd that this isn't actionable in GraphQL at all. Is this just default behavior for all REST endpoints, and preparation for the future?