Ad

Shopify GRAPHQL Admin

- 1 answer

I am really new in shopify Api and Graphql.

I created an api call and it returns an error 429 Too many request, i talked to their support and said that i shouldn't put the Graphql call and API on my code.

My question is, how do i put this on my server and use it on my shopify store?

{
  productVariants(first:1, query:"barcode:155799") {
    edges {
      node {
        inventoryQuantity
        legacyResourceId
        barcode
        price
        compareAtPrice
        availableForSale
      }
    }
  }
}

These are the things i needed. on postman i tried it and works, my question, where will I put my code? Can't put it on my Theme file as not secure showing my Access Token.

Ad

Answer

This request is using the GraphQL Admin API and it shouldn't be used in the frontend.

This GraphQL Admin API should be used in an APP of so't be used in the frontend.

This GraphQL Admin API should be used in an APP of some sort.

There is a separate Storefront API that uses GraphQL but all the methods are different and limited. See https://help.shopify.com/en/api/storefront-api/reference


As for:

429 Too many request

This happens when you use up your bucket limit. Each request have a cost of some points and if you go outside the allowed request limit ( 1000 points ) you will receive -429 Too many request.

More on the matter can be read here: https://help.shopify.com/en/api/graphql-admin-api/graphql-admin-api-rate-limits

Ad
source: stackoverflow.com
Ad