graphene-django-extras icon indicating copy to clipboard operation
graphene-django-extras copied to clipboard

Limit the number of subresults of a list

Open yannRavels opened this issue 6 years ago • 3 comments

Hi,

I'm wondering if it's possible to limit the number of subresults as on the example: https://graphql.org/learn/pagination/ Like

query{
  allBrand(brand:"3715ad6b"){
    results{
      name,
      feeds(limit: 2){
        media{
           image @resize(width:30)          
        }
      }
    }
}

or

query{
  allBrand(brand:"3715ad6b"){
    results{
      name,
      feeds(first: 2){
        media{
           image @resize(width:30)          
        }
      }
    }
}

yannRavels avatar May 25 '18 18:05 yannRavels

Hello, @yannRavels , currently the module does not allow that paginated sub, but I will analyze it and see if I can include it in next updates. Thanks for reporting

eamigo86 avatar May 30 '18 14:05 eamigo86

Thank you! On May 30, 2018, 17:44 +0300, Ernesto Pérez Amigo [email protected], wrote:

Hello, @shalakhin, currently the module does not allow that paginated sub, but I will analyze it and see if I can include it in next updates. Thanks for reporting — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

shalakhin avatar May 30 '18 14:05 shalakhin

I believe we are using it, you just need to give an alias to the sub query like this

    feeds: feeds(first: 2) {

jstacoder avatar Jul 19 '18 03:07 jstacoder