Problem requesting fields through the graphql admin api

Solved
Highlighted
New Member
3 1 0

Hello,

I'm trying to perform a query on products through the graphql api : 

Except that I'm getting errors saying that specific fields are not part of the object itself  in my example it's 

 Field 'isGiftCard' doesn't exist on type 'Product'

(although and according to documentation it does exist) 

knowing that : i'm using a graphql client with version 2020-04

and these are the the scopes I'm requesting : 

 

 

      "scopes":"unauthenticated_read_product_inventory,unauthenticated_read_product_listings,unauthenticated_write_checkouts,unauthenticated_read_checkouts,unauthenticated_read_customers,read_products",

 

 

This is the mutation i'm performing : 

 

 

query {
  collectionByHandle(handle: "${collectionHandle}") {
    products(first: 100) {
      edges {
        node {
          id
          title
          createdAt
          description
          descriptionHtml
          handle
          onlineStoreUrl
          publishedAt
          tags
          title
          updatedAt
          vendor
          isGiftCard
          totalInventory
          images(first:100){
            edges{
              node{
                altText
                originalSrc
                id
              }
            }
          }
          options{
            id
            name
            values
          }
          variants(first: 100) {
            edges {
              node {
                id
                inventoryItem {
                  requiresShipping
                }
                selectedOptions{
                  name
                  value
                }
                image{
                  id
                  originalSrc
                }
                title
                priceV2{
                  amount
                  currencyCode
                }
                sku
                weight
                weightUnit
                compareAtPrice
              }
            }
          }
        }
      }
    }
  }
}`;

 

 

 

 

Thanks in advance ! 

 

 

0 Likes
Highlighted
New Member
3 1 0

This is an accepted solution.

My bad, i was requesting the storefront api instead of the admin api

0 Likes