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: GraphQL. Product tag is cached.

GraphQL. Product tag is cached.

kushniruk
Shopify Partner
5 0 7

Hello, everyone.
I'm having an issue with product tags.
After the update the product tags via API, the graphQL query still works with old product tags.
Only after ~10 seconds, it returns me correct response filtered by a newly added tag.
My query:

 query {
      products(query: "tag:*(my-added-tag)*", first: 10) {
        edges {
          node {
            id
            title
            productType
            images(first: 1) {
              edges {
                node {
                  originalSrc
                  altText
                }
              }
            }
            variants(first: 1) {
              edges {
                node {
                  presentmentPrices(first: 1) {
                    edges {
                      node {
                        price {
                          amount
                          currencyCode
                        }
                      }
                    }
                  }
                  id
                }
              }
            }
          }
        }
      }
  }

Any suggestions? 

Thanks.

 

Replies 8 (8)

drovani
Shopify Partner
2 0 4

Bumping this - hoping someone has been able to find a solution!

We have been running into the exact same problem. There is a 10-45s delay between when we write an update to one or more product's tags using the REST API and when that update is reflected in the results of a GraphQL query.

RXVTeam
Visitor
1 0 3

Same issue. When our client changes shopify tags and then uses our tool to query (by tag) & process orders, they get out of date information!

patrickb
Shopify Partner
57 0 13

Hi all! Did anyone ever get this sorted out?

Recipe Kit - Easy, beautiful & SEO friendly recipe cards on your Shopify blog posts - https://apps.shopify.com/recipe-kit
Wait.li - Product Waiting Lists - https://apps.shopify.com/product-waiting-lists
Better Blog Comments - threaded comments, email notifications, improved spam protection, and more - https://apps.shopify.com/blogcomments
drovani
Shopify Partner
2 0 4

For our needs, this is still an ongoing problem; we have had to put in wait timers and notices to the user that the data will be updated "soon".

It's a poor user experience, but it's all we have to go off of right now.

JonathonMinard
Shopify Partner
7 1 2

Our integration is running into this too when querying for orders from Shopify.  If a user adds a certain tag to an order we don't want to import the order into our system, but if the user adds the tag and runs our integration within a minute afterwards the order still imports.

bmcalexander
Shopify Partner
1 0 1

This seems to be still a problem. It is in the Orders object as well. Wow, this can cause some serious issues with integrating with ERP system. Duplicate orders are a problem if you use the tag field to mark an order as processed. Hope there is a solution soon. 

 

Work around, check the tag fields of the returned object for the tag you are looking for or not looking for to be there.

AminRafaey
Shopify Partner
6 0 1

Does this ever get resolved? I am facing the same problem.

ShopifyDevSup
Shopify Staff
1453 239 534

Hey @AminRafaey , thanks for following up on this here. I have tested on my end and I also see around 9-10 seconds before the tag is returned in a query filter. 
I'll be sure to let our product teams know that this has been an ongoing issue so they can look in to ways to improve the speed that this is available through the filter query. 

The data is being written immediately though, so a couple of options here in the meantime would be to use the Products Update webhook to get immediate updates when a tag is changed or added, or you can query the product by ID to return it's tags. 

 

Hope that helps, 

 

- Kyle G.

Developer Support @ Shopify
- Was this reply helpful? Click Like to let us 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