productTypes, productTags, productVendors pagination not working in graphql

tahafarooqui
Tourist
8 0 2

There is a bug which is still not solved after so many complains about this issue.

  1. after parameter is missing, It is not working. 
  2. hasNextPage always return false, When there is more items.
  3. first: 10 This will return only 1 item, It should return 10 items. I guess there is a problem with 0.
  4. Please add endCursor parameter in pageInfo. See original graphql documentation . Hint

 

    {
    shop {
      productTypes  (first: 10, after:"cursor") {
        edges {
          node
          cursor
          }
          
          pageInfo {
              hasNextPage
              hasPreviousPage
          }    
          
          
        }
        

     
      }
    
  }

 

_JB
Shopify Staff
Shopify Staff
823 97 178

Hey @tahafarooqui,

 

I've been able to replicate the issue you describe in #1 and #2. It seems we return PageInfo but don't accept any cursor arguments for that object. I'll be raising this with our developers to clarify the expected behaviour, and I'll post back here once I have an update.

 

I wasn't able to replicate what you described in your point #3. When I ask for the first 10 results in my test store, I get 10 back as expected. Are you sure the store you're querying has more than 1 product type?

 

For #4 please note that this isn't mentioned in our documentation and isn't currently expected in the pageInfo response. I will submit feedback to our product teams to have this property added, which will ensure it can be considered for any future changes to the platform. I can't make and promises as to if/when this will be implemented, but I will make sure this information gets to the right people who can make that decision.

JB | Developer Support @ 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

tahafarooqui
Tourist
8 0 2

Does it fixed ?? any response

0 Likes
IvanPrestalia
New Member
2 0 1

Hello @_JB , is there any news on this subject? We are developing apps that would benefit from this to work, as otherwise you need to cycle through all the products in order to get these infomations.

0 Likes
sarangnx
New Member
1 0 0

Any update with this issue?

Currently I have to query with

 

{
  products(first: $limit, after: $cursor){
    edges{
      node{
        tags
      },
      cursor
    },
    pageInfo{
      hasNextPage
    }
  }
}

 Instead of this:

{
  shop{
    productTags(first: $limit, cursor: $cursor){
      edges{
        node
        cursor
      },
      pageInfo{
        hasNextPage
      }
    }
  }
}

 

BTW, I came across a query to /admin/internal/web/graphql/core endpoint.
I was wondering If I could use that in my app? instead of admin/api/2021-01/graphql.json

query ShopProductTags($sort: ShopTagSort) {
      shop {
        id
        allProductTags(sort: $sort)
        __typename
      }
    }

 

0 Likes