What's your biggest current challenge? Have your say in Community Polls along the right column.
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Re: [BUG] cartTransforms query always returns an empty array

[BUG] cartTransforms query always returns an empty array

basilkhan
Shopify Partner
49 0 5
Merchants using our app that have already enabled the `cartTransform` function using the `cartTransformCreate` mutation (https://shopify.dev/docs/api/admin-graphql/2023-10/mutations/cartTransformCreate) aren't able to retrieve the cart transform functions using the query: https://shopify.dev/docs/api/admin-graphql/2023-10/queries/cartTransforms

```
query cartTransforms {
cartTransforms(first: 25) {
edges {
node {
functionId
id
}
}
}
}
```
This always returns empty results:
```
{
"data": {
"cartTransforms": {
"edges": []
}
},
"extensions": {
"cost": {
"requestedQueryCost": 27,
"actualQueryCost": 2,
"throttleStatus": {
"maximumAvailable": 1000,
"currentlyAvailable": 967,
"restoreRate": 50
}
}
}
}
```
This is particularly an issue for merchants who re-install the app and when enabling (trying to create) returns a userError of `Could not enable cart transform because it is already registered`. Trying to query always returns an empty array, which leaves the merchants without the ability to retrieve the cart transform function.

Also, do cart transform functions expire once the merchant uninstalls the app? Does this mean we need to able to retrieve it, delete and re-create the cart transform function?

 

Co-founder and Product Developer at Freshly Commerce ️ | Building Simple Bundles, Simple Discounts, and Freshly Inventory
Replies 21 (21)

Liam
Community Manager
3108 344 895

HI Basilkhan,

 

Are you only seeing this issue for merchants who uninstall/reinstall your app? When a merchant uninstalls your app, the cart transforms created by the app should be automatically removed by Shopify. 

Liam | Developer Advocate @ 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

basilkhan
Shopify Partner
49 0 5

Hi @Liam

 

I believe this is only for merchants who uninstall/reinstall our app.

> When a merchant uninstalls your app, the cart transforms created by the app should be automatically removed by Shopify. 

Doesn't seem like it's true because during the re-install, when we try to register the cart transform function (cartTransformCreate) we receive "Could not enable cart transform because it is already registered" as a userError and when we try to query the cart transform function it returns no results. Maybe it does automatically remove but the API doesn't register that for some reason. 🤔

Co-founder and Product Developer at Freshly Commerce ️ | Building Simple Bundles, Simple Discounts, and Freshly Inventory

Nick_Wesselman
Shopify Staff
171 43 73

There should be a fix live for this now.

Nick Wesselman | 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

basilkhan
Shopify Partner
49 0 5

Thanks @Nick_Wesselman! I might have missed the initial detail that this was specifically with merchants who have reinstalled the app. @Liam mentions that the cart transform function should be removed after uninstall, but we are seeing the user error "Could not enable cart transform because it is already registered" on re-install with cartTransformCreate and query returns empty results. 

Our merchants who re-installed are still running into this bug even after the fix and not able to enable the cart transform function.

Co-founder and Product Developer at Freshly Commerce ️ | Building Simple Bundles, Simple Discounts, and Freshly Inventory
sevenminds
Shopify Partner
13 0 3

I am still able to reproduce the issue.

 

After reinstalling the app, there was no cart transforms, which was expected since the app had just been installed.

"cartTransforms"=>{"nodes"=>[]}


However, the cartTransformCreate mutation is giving an error message that says:

 

"cartTransformCreate"=>{"cartTransform"=>nil, "userErrors"=>[{"field"=>["functionId"], "message"=>"Could not enable cart transform because it is already registered"}]}

 

Basically when a store reinstalls the app, they can't use it anymore.

AV_SL
Shopify Partner
39 4 11

Confirming the issue is still present for me too with these exact results.

Also, the cart transform being removed on app uninstall isn't the occurring.

Biscuits Bundles App - Create beautiful mix and match bundles using native Shopify bundles functionality.

Nick_Wesselman
Shopify Staff
171 43 73

Can y'all confirm now (again) whether this has been resolved for you?

Nick Wesselman | 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

sevenminds
Shopify Partner
13 0 3

This issue has been resolved for us. Many thanks to Nick and the rest of the team!

AV_SL
Shopify Partner
39 4 11

Confirmed working as expected for us to. Thanks a heap!

Biscuits Bundles App - Create beautiful mix and match bundles using native Shopify bundles functionality.
SGSdev
Shopify Partner
18 2 7

Bumping this thread.

@Nick_Wesselman I am also seeing the same problem as @basilkhan where the same cartTransform query returns an empty array. In my case the cart transform function is actually installed and working in the store, but the query still returns nothing.

 

I'm testing on a development store, if that matters.

rishad45
Shopify Partner
13 0 1

I am also facing the same issue. Is there any way to get functionId of already registered cartTransform Function??

SGSdev
Shopify Partner
18 2 7

Double bump.

There is an accepted solution to this thread, but I still have the problem and apparently so do others. Can we un-accept and get someone to look into it? @Shopify 

Nick_Wesselman
Shopify Staff
171 43 73

Can you provide more details and/or open a new thread on this? Is it after app uninstall? Can you provide any repro steps?

Nick Wesselman | 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

SGSdev
Shopify Partner
18 2 7

This is not after app uninstall. This is at any point on multiple stores, even immediately after a fresh install. I just installed a cart transform function on a store this week, and then ran this query which returned an empty array.

 

query {
cartTransforms(first: 25) {
nodes {
id
functionId
}
}
}

 

The cart transform function is installed and working, but the query returns nothing. My solution so far has been to save the cart transform ID that gets returned when I first install, but it would be nice to be able to pull that ID later rather than just write it down and hope I don't lose it. There are still several others in this thread that are reporting the same issue, so it's not just me.

 

Mike_DiSanto
Shopify Partner
3 0 1

Having the same issue. Just using the GraphQL API explorer app to manually install a cartTransform, now unable to fetch the ID to delete it. The query always returns an empty array.

sublimina
Shopify Partner
5 0 2

I am also getting no cart transforms back when I try to query cartTransforms. I know I had created 2 cart transforms. Without knowing the cartTransform ID, I cannot delete them now.

davidqhr
Shopify Partner
2 0 0

Same here

davidqhr
Shopify Partner
2 0 0

test env. Still have this issue.

seymur_crsp
Shopify Partner
67 4 10

Hello. I'm experiencing the same problem right now. I uninstalled the app, and after reinstalling it I cannot create a cart transform because it says it's already created. However, running the cartTransforms query returns empty array of nodes. As a result, I cannot delete the old cart transform without knowing its ID

khalidansari
Shopify Staff
1 0 1

Hi! This is fixed now. GraphiQL app should be able to query and delete any cart transform records. Hope this helps.

seymur_crsp
Shopify Partner
67 4 10

Thank you!